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

lookup should allow rich data as values

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.9.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      Hide

      It should be possible to use any data value that has a corresponding Pcore data type except the Runtime type which shall remain invalid.

      When merging, all non Array or Hash values should be treated as atomic non mergeable values.

      Show
      It should be possible to use any data value that has a corresponding Pcore data type except the Runtime type which shall remain invalid. When merging, all non Array or Hash values should be treated as atomic non mergeable values.
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDS 2016-11-30, PDE 2016-12-14
    • Release Notes:
      New Feature
    • Release Notes Summary:
      Hide
      It is now possible to have lookup produce values other than the restricted set of data types - for example, Sensitive values can be returned directly. This is of value when a defined resource type or class has declared that it requires a Sensitive type. Earlier it was impossible to deliver such a value via data binding. To return such a value, it must be returned by a function, it cannot be directly produced with a hiera compatible yaml or json data file.
      Show
      It is now possible to have lookup produce values other than the restricted set of data types - for example, Sensitive values can be returned directly. This is of value when a defined resource type or class has declared that it requires a Sensitive type. Earlier it was impossible to deliver such a value via data binding. To return such a value, it must be returned by a function, it cannot be directly produced with a hiera compatible yaml or json data file.
    • QA Risk Assessment:
      Automate
    • QA Risk Assessment Reason:
      needs acceptance. add rich types to existing tests.

      Description

      In the first iteration of lookup v5 the set of data that lookup can return is limited to (in principle) the Data type. This is an issue because we want to be able to return rich data types such as a Sensitive, semver or time related types, as well as instances of Pcore Objects.

      The validation of the data type should be related to allow anything that is described by the Puppet type system except the Runtime types.

      While it may be appealing to be able to deep merge some of the data types (for instance a Sensitive[Hash], it is difficult in practice since a sensitive value is not supposed to reveal its content, and when merging and explaining clear text is needed in order to explain what a merge did.

      For Objects in general it is not possible to determine if they represent something that should be perceived as a "single value", or if they represent a mergeable "container".

      I can imagine users using something like Initializer[T] entries if there is a desire to merge the parameters to a new. I think that is a separate issue if we want to go there and if there is demand for being able to such merges.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                henrik.lindberg Henrik Lindberg
                QA Contact:
                Eric Thompson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support