Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-2532

parameter lookup produces screwy result for default values



    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 3.7.0
    • Compiler, Docs
    • None


      When the future parser "lookup resource parameter" evaluates and there is no parameter value set by the evaluated manifest logic at that point, the evaluator then looks up the default value for that parameter.

      This unfortunately looks up the default value as seen from the perspective of the "lookup resource parameter" scope/context, and not the context in which the resource was defined. Thus, the evaluator will produce a "lie" in every other context except the one where the resource was defined.

      This is unacceptable.

      There are different ways to solve this:

      • Do not ever lookup default (rationale: we don't know what the value ending up in the catalog will be until it is actually computed at the end of the compilation when no more user logic will be evaluated).
      • Do the same kind of lookup as the compiler does (rationale: provides the best knowledge about what the value probably will end up being if nothing else is evaluated that affects the outcome, which by the way is the best the parameter lookup can achieve at any point throughout the evaluation).

      The 'do not provide defaults' may seem harsh, but it is far better than producing erroneous/misleading results.

      Story points of 2 reflects attempting to do the more difficult option (lookup in correct scope). Suggest attempting that, but if that does not work out with a cap on time, then skip looking up default.


        Issue Links



              Unassigned Unassigned
              henrik.lindberg Henrik Lindberg
              Kurt Wall Kurt Wall
              0 Vote for this issue
              3 Start watching this issue



                Zendesk Support