-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable nested profiles #1572
Enable nested profiles #1572
Conversation
When I @anderbubble let me know if my test is ok, I think I want to add some more checks to it around tags/values in netdev and ipmi, but wanted to start simple. |
Using the profile name as sorting order sound arbitrary and I don't like the idea. Still it might be the best solution as
|
@mslacken I played a little with the idea of building a graph and merging profiles in the order they are specified/included, but eventually settled on the approach of flattening the list of profiles and sorting as a compromise that makes it easy to understand how the merging is done and easier to control the order in the case someone wants to do that. In my local WW foo I've found that both overlays and profiles work much better and much more understandably if I stick to the best practice of never setting the same value in multiple profiles and never letting two included overlays touch/modify the same file. The further I go down the profile/overlay rabbit hole the more I lean toward detecting either of those things happening and throwing an error or at least a warning when it does happen as it, at least in my experience, always leads to confusion and regret when it happens. |
This still needs some work. Tags merge correctly but overlays are not appending correctly, presumably |
Figured out the issue with overlays so this currently works w.r.t. properly merging profiles and overlays included in profiles. It looks like moving I can update the failing tests so they pass with the new structure, but want to make sure that is the correct solution before I start doing that. |
8164890
to
4ddee90
Compare
1. Move Profiles from Node struct to Profile struct. 2. Recursively include nested profiles in profiles, eliminating duplicates and loops. 3. Sort the profile list alpanumerically 4. Merge such that later profiles overwrite values in earlier profiles, with the node config being the last thing merged.
d33e57a
to
65c413a
Compare
Closing in favor of #1598 |
Description of the Pull Request (PR):
Write your description of the PR here. Be sure to include as much background,
and details necessary for the reviewers to understand exactly what this is
fixing or enhancing.
This fixes or addresses the following GitHub issues:
Reviewer checklist
The reviewer checks the following items before merging the PR.
git commit --signoff
) in agreement to the DCO