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

fix: correct merge logic for conditional rules #287

Merged
merged 1 commit into from
May 2, 2021

Conversation

backjo
Copy link
Collaborator

@backjo backjo commented May 1, 2021

this PR fixes a few bugs in the conditional rule logic for fields that can be merged, notably:

  1. On 'merge' fields, the conditional value was being merged into the resource value before the default value was merged. This would cause the default value to take priority over the conditional value, which was not intended.
  2. On 'merge' fields, the conditional value was not being set if a conflict was not present.
  3. On 'mergeOverride' fields, the conditional value was replacing the default value. Now, it is merged with the default value, with the conditional value taking priority.

It also allows the userData field to be merged on the name key.

@backjo backjo requested review from a team as code owners May 1, 2021 22:45
@codecov
Copy link

codecov bot commented May 1, 2021

Codecov Report

Merging #287 (d7367d5) into master (06da69c) will decrease coverage by 0.04%.
The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #287      +/-   ##
==========================================
- Coverage   70.23%   70.19%   -0.05%     
==========================================
  Files          19       19              
  Lines        2970     2979       +9     
==========================================
+ Hits         2086     2091       +5     
- Misses        755      758       +3     
- Partials      129      130       +1     
Impacted Files Coverage Δ
controllers/provisioners/config.go 77.10% <69.23%> (-1.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06da69c...d7367d5. Read the comment docs.

@backjo backjo force-pushed the fix/conditional-bugs branch 2 times, most recently from e4cfed0 to 57c2672 Compare May 1, 2021 22:53
Signed-off-by: Jonah Back <jonah@jonahback.com>
@backjo backjo merged commit 541ec27 into master May 2, 2021
@backjo backjo deleted the fix/conditional-bugs branch May 2, 2021 02:42
@eytan-avisror eytan-avisror mentioned this pull request May 8, 2021
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.

2 participants