-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🐛 ClusterClass: allow accessing nestedFields via valueFrom.variable #5925
🐛 ClusterClass: allow accessing nestedFields via valueFrom.variable #5925
Conversation
Signed-off-by: Stefan Büringer [email protected]
// validating if the whole path is an existing variable. | ||
// This could be done by re-using getVariableValue of the json patch | ||
// generator but requires a refactoring first. | ||
variableName := getVariableName(*jsonPatch.ValueFrom.Variable) |
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'm aware that we're duplicating more logic here, similar to how we did above with the builtin variable validation.
But I think for now it's the pragmatic thing to do. I think long-term we should clean it up so that the webhook can re-use code of the JSON patch generator for validation to allow more powerful validations (and less duplicate code/logic).
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Stefan Büringer [email protected]
What this PR does / why we need it:
With this PR it's now possible to access nested fields of complex variables (objects and arrays) via
.valueFrom.variable
. This was already implemented in the JSON patch generator, but blocked by the webhook.I think complex variables and the Patch validation were implemented at the same time so we missed it.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #