Skip to content

Conversation

@eytan-avisror
Copy link
Collaborator

Signed-off-by: Eytan Avisror [email protected]

Fixes #341

This fixes a gap in our admin configuration where we allow CRs to use restricted fields if there are no defaults.
This change sets field to Nil if there is no default value provided and field is a restricted field.

@eytan-avisror eytan-avisror requested a review from backjo February 4, 2022 19:42
@eytan-avisror eytan-avisror requested review from a team as code owners February 4, 2022 19:42
// if no default value exist, make sure to ignore CR value for restricted fields
err := unstructured.SetNestedField(unstructuredInstanceGroup, nil, path...)
if err != nil {
errors.Wrap(err, "failed to set nested field to nil")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@backjo I just noticed we are not returning any of these errors here.. do you remember if we did this intentionally? Thinking we should return these errors to caller WDYT

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 I don't think it was intentional

@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #345 (3806286) into master (c321140) will decrease coverage by 0.00%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #345      +/-   ##
==========================================
- Coverage   51.15%   51.15%   -0.01%     
==========================================
  Files          33       33              
  Lines        4510     4514       +4     
==========================================
+ Hits         2307     2309       +2     
- Misses       2062     2063       +1     
- Partials      141      142       +1     
Impacted Files Coverage Δ
api/v1alpha1/zz_generated.deepcopy.go 0.00% <ø> (ø)
controllers/provisioners/config.go 76.47% <33.33%> (-0.64%) ⬇️

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 c321140...3806286. Read the comment docs.

Signed-off-by: Eytan Avisror <[email protected]>
@eytan-avisror eytan-avisror merged commit bda2adc into keikoproj:master Feb 7, 2022
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.

Changing a boundary does not roll back changes on CRs

2 participants