Jira (HI-223) Hiera 'deeper' merge knockout only knocks out from closest array

16 views
Skip to first unread message

Henrik Lindberg (JIRA)

unread,
Apr 5, 2017, 11:25:02 AM4/5/17
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug HI-223
 
Re: Hiera 'deeper' merge knockout only knocks out from closest array

Can you try this on puppet >= 4.9.4 using hiera 5? Is the behavior the same?
Ping Thomas Hallgren

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Alex Elman (JIRA)

unread,
Aug 23, 2017, 7:17:02 AM8/23/17
to puppe...@googlegroups.com
Alex Elman commented on Bug HI-223

Henrik Lindberg That's a version quite newer than what we're running so I'll have to test this in a separate environment with mocked code. I'll do so and respond within the next week or so.

Austin Boyd (Jira)

unread,
Apr 6, 2020, 5:44:02 PM4/6/20
to puppe...@googlegroups.com
Austin Boyd updated an issue
 
Hiera / Bug HI-223
Change By: Austin Boyd
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 38759
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Garrett Guillotte (Jira)

unread,
Apr 6, 2020, 5:44:02 PM4/6/20
to puppe...@googlegroups.com

Austin Boyd (Jira)

unread,
Apr 6, 2020, 5:44:04 PM4/6/20
to puppe...@googlegroups.com

Jarret Lavallee (Jira)

unread,
Apr 9, 2020, 7:16:03 PM4/9/20
to puppe...@googlegroups.com
Jarret Lavallee updated an issue
Change By: Jarret Lavallee
CS Priority: Needs Priority Reviewed

otheus (Jira)

unread,
Apr 24, 2021, 12:14:04 PM4/24/21
to puppe...@googlegroups.com
otheus commented on Bug HI-223
 
Re: Hiera 'deeper' merge knockout only knocks out from closest array

Bump. In order for Hiera to be somewhat effective in even reasonably complex hierarchies, the knock-out function is very important.  

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Stefan Strandberg (Jira)

unread,
May 21, 2021, 3:35:01 PM5/21/21
to puppe...@googlegroups.com

I agree that this is important, this is confusing and not readily apparent.  It shouldn't matter how many "layers" there are in hiera - any knockout prefix in a higher-priority yaml should remove it in the final array no matter how many lower-priority yamls there are that may or may not have the original array entry.

otheus (Jira)

unread,
Apr 7, 2022, 9:13:02 AM4/7/22
to puppe...@googlegroups.com
otheus commented on Bug HI-223

This bug still persists in Puppet6. We (at the University of Innsbruck, myself and a colleague of mine), implemented a knockout solution for the `classes` variable, used in our r10k setup in the main `manifests/site.pp` file. The full solution is attached, provided via the Public Domain. 

The solution is actually a merger of two independent solutions:

  1. An elegant method of using `--class` to knockout any classes defined in the merged list, properly, as one would expect it to work per aelman 
  2. A hackier version where one can declare a variable named `class_override_CLASSNAME` with the value of 
    • none – ignore this variable and do whatever the "class" array merges to after applying the full knockout algorithm
    • enable – keep this class regardless of the full knockout algorithm
    • disable – discard this class regardless of what is found in the classes list

I tried to make the code as simple to understand and commented to explain ambiguities. 

The algorithm can be adapted to the core deep-merge strategy. I encourage the community to apply the basic logic of this to that functionality, so that this will work across all variables, not just classes. knockout-classes-merged.txtlink_attachment_7.gif

This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

otheus (Jira)

unread,
Apr 7, 2022, 9:13:03 AM4/7/22
to puppe...@googlegroups.com
otheus updated an issue
 
Change By: otheus
Attachment: knockout-classes-merged.txt

Alex Elman (Jira)

unread,
Apr 7, 2022, 2:43:03 PM4/7/22
to puppe...@googlegroups.com
Alex Elman commented on Bug HI-223
 
Re: Hiera 'deeper' merge knockout only knocks out from closest array

henrik.lindberg I submitted the original MR on an older version of deep_merge. I'm still interested in helping move this over the line so let me know how I can help.

Reply all
Reply to author
Forward
0 new messages