-
Notifications
You must be signed in to change notification settings - Fork 295
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
Remove immutable fields when patching VM Service VMs after creation #2430
Comments
Question: does VM Operator only mutate the If it also mutates the same on Update there should not be a patching issue. |
Yes. Once a VM is created, its imageName field cannot be changed which is enforced by the VM validation webhook. |
To be clear, the validation webhook to prevent mutating the
Also, the reason we do not do this is because the |
Sounds like we should make the corresponding fields on the VSphereMachine immutable in CAPV (currently we don't have any webhooks on this type) |
Ack, but as addition: don't try to patch it on an existing object / ignore if it is already set to match the above scenario. |
It's just pretty confusing to have a field which is then just not applied without any sort of error |
I think the best we can do on CAPV side is:
|
We could also return errors in some condition theoretically if the desired state cannot be applied |
Okay I think now I got the ask
So the ideal way to address this is probably:
|
I think we should fix, but this vm-operator behavior of mutating a spec value provided by something else is sort of unusual and unexpected. |
Cherry-picks:
We will publish releases for 1.7 and 1.8 after merging. |
/reopen The fix did not include We should file another PR which also adds the same behaviour for the |
@chrischdi: Reopened this issue. 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/test-infra repository. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
@chrischdi Do you still remember where we are with this issue? I think we did it all? |
I think we can close this. resourcePolicyName was also implemented: |
/close |
@chrischdi: Closing this issue. 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/test-infra repository. |
/kind feature
Describe the solution you'd like
Currently, the following fields are immutable after a VM Service VM resource is created (related code in vmop repo):
Therefore, patching these fields after a VM Service VM is created could potentially be denied, as they might be updated during the VM creation by a mutation webhook.
Anything else you would like to add:
For example, in the latest VMOP version,
vm.spec.imageName
can be mutated from a friendly image name to a "vmi-" name if there is a single VM image that can be resolved. If CAPV continues patching such VM with the previous friendly image name, the request would be denied as the imageName is an immutable field, leading to reconciliation errors for TKG VMs.Environment:
N/A.
The text was updated successfully, but these errors were encountered: