Skip to content
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

Merge blueprint vendor data #3315

Merged
merged 2 commits into from
Nov 28, 2023
Merged

Merge blueprint vendor data #3315

merged 2 commits into from
Nov 28, 2023

Conversation

andrei-toterman
Copy link
Contributor

@andrei-toterman andrei-toterman commented Nov 24, 2023

This PR makes it so that cloud-init vendor data coming from a blueprint is merged with the vendor data that we normally provide. The merging follows these rules:

  • If a key refers to a scalar value in both our vendor data and the blueprint vendor data, the blueprint is rejected
  • If a key refers to values of different types in our vendor data and the blueprint vendor data, the blueprint is rejected
  • If an entry from the blueprint vendor data does not exist in our own vendor data, simply add it
  • If a key refers to a sequence in both our vendor data and the blueprint vendor data, append the items from the blueprint sequence to the sequence from our data
  • If a key refers to a map in both our vendor data and the blueprint vendor data, recurse this algorithm on each key from the blueprint map

Fixes #3247

@andrei-toterman andrei-toterman force-pushed the merge-blueprint-vendor-data branch from 89d9997 to 1149311 Compare November 24, 2023 12:02
Copy link

codecov bot commented Nov 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4ec525d) 84.01% compared to head (1149311) 84.02%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3315      +/-   ##
==========================================
+ Coverage   84.01%   84.02%   +0.01%     
==========================================
  Files         250      250              
  Lines       13487    13503      +16     
==========================================
+ Hits        11331    11346      +15     
- Misses       2156     2157       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@townsend2010 townsend2010 self-requested a review November 28, 2023 16:05
Copy link
Contributor

@townsend2010 townsend2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @andrei-toterman!

Thanks for this. LGTM and works as advertised!

@townsend2010 townsend2010 added this pull request to the merge queue Nov 28, 2023
Merged via the queue into main with commit 6e5e345 Nov 28, 2023
@townsend2010 townsend2010 deleted the merge-blueprint-vendor-data branch November 28, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passed in cloud-init with write-files defined overwrites pollinate data
2 participants