Jira (PUP-8593) Add alias to lookup_options and make it redirect to lookup of the alias

8 views
Skip to first unread message

Henrik Lindberg (JIRA)

unread,
Mar 23, 2018, 6:57:04 AM3/23/18
to puppe...@googlegroups.com
Henrik Lindberg created an issue
 
Puppet / New Feature PUP-8593
Add alias to lookup_options and make it redirect to lookup of the alias
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2018/03/23 3:56 AM
Priority: Normal Normal
Reporter: Henrik Lindberg

The existing hiera interpolation function alias is problematic to use. By adding a key alias in lookup_options for an original-key a lookup should take that alias-key and use it to lookup instead of the given original-key.

Details:

  • The implementation must guard against circular aliases
  • There is an option wrt handling of the other lookup_options:
    1. Use the options for original-key and ignore those in alias-key
    2. ignore the options for original-key and use those for the alias-key
    3. merge the options with original-key at higher t
  • If an alias-key is in turn aliased, the process recurses

Option 3 allows for just specifying alias and getting the rest of the options from the aliased key.

We can also add advanced features:

  • If the alias-key is an array, the entries in that array are used as aliased lookups and the result is an array with those values.
  • If the alias-key is a hash, the keys are used as keys in the resulting hash where values are the looked up keys
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Thomas Hallgren (JIRA)

unread,
Jan 28, 2020, 1:34:04 PM1/28/20
to puppe...@googlegroups.com
Thomas Hallgren commented on New Feature PUP-8593
 
Re: Add alias to lookup_options and make it redirect to lookup of the alias

A simpler, and perhaps more straight forward solution that was proposed in PUP-8341, is to introduce an additional interpolation function. This has already been done in the Go version of Hiera. The function is called `strict_alias` and behaves like `alias` with the exception that a not found is propagated instead of translated into an empty string.

Henrik Lindberg (JIRA)

unread,
Jan 28, 2020, 2:04:03 PM1/28/20
to puppe...@googlegroups.com

Thomas Hallgren That is solving PUP-8341, a completely different problem than this ticket (what is described above would also benefit from having some kind of "strict" option). I think PUP-8341 should be reopened for the purpose of adding strict_alias interpolation function.

This ticket is about having a more powerful mechanism for aliasing than what is currently possible with the hiera interpolation functions.

Thomas Hallgren (JIRA)

unread,
Jan 28, 2020, 2:21:03 PM1/28/20
to puppe...@googlegroups.com

Not sure why that is. The only thing that the current alias doesn't, is to propagate the "not-found" condition. It preserves the type and it guards against recursion. Perhaps I'm missing something but besides the "advanced features" (which I personally think we should avoid), I don't see more value added here.

Maggie Dreyer (Jira)

unread,
Mar 31, 2021, 1:26:04 PM3/31/21
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
 
Change By: Maggie Dreyer
Component/s: Hiera & Lookup
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages