-
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
🐛 topology: use raw input object for patch calculation in WalkTemplates #10912
🐛 topology: use raw input object for patch calculation in WalkTemplates #10912
Conversation
/assign @fabriziopandini @sbueringer |
/test help |
@chrischdi: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/test pull-cluster-api-e2e-main |
Thx! /lgtm |
LGTM label has been added. Git tree hash: 75cb9509c476eb5d2eeb995bd88f830866b838ce
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer 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 |
What this PR does / why we need it:
This PR adjusts the WalkTemplates function provided for runtime extensions to use the original input struct to calculate patches.
Before it did use the typed objects to marshal them and create the patch.
This could lead to invalid patches because the Go struct may have fields which the original input did not have.
Example for
VSphereClusterTemplate
from here: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/apis/v1beta1/vsphereclustertemplate_types.go#L33Consider the following input from the patch request (the template referred by the ClusterClass):
decoding and marshalling again made the following out of it:
Now we calculate the patch based on the following:
The old behaviour would have created the following patch:
This patch would fail in CAPI to get applied to the template with following error:
The new behaviour would create the following patch, which would work:
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 #
/area runtime-sdk