-
Notifications
You must be signed in to change notification settings - Fork 40
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
Enforce Restricted Fields usage when no default value #345
Enforce Restricted Fields usage when no default value #345
Conversation
Signed-off-by: Eytan Avisror <eytan_avisror@intuit.com>
Signed-off-by: Eytan Avisror <eytan_avisror@intuit.com>
controllers/provisioners/config.go
Outdated
// 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") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 Report
@@ 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
Continue to review full report at Codecov.
|
Signed-off-by: Eytan Avisror <eytan_avisror@intuit.com>
Signed-off-by: Eytan Avisror eytan_avisror@intuit.com
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.