-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Using server-side-apply for an Ingress failed when updating IngressBackend from port number to port name #125869
Comments
/sig network |
So, on one hand you made a problem when you used two different owners to manage one aspect of the object. On the other hand, I think you're right that it SHOULD work. Probably. I ACK the issue and reproduced it.
I ran update-codegen and built a KinD cluster from HEAD.
|
@pohly this may be something you want to look at for DRA API - I didn't even realize this was a thing until today :) |
The API uses SSA will auto-migrate existing resources using kubernetes-sigs/structured-merge-diff#170 once the |
/triage accepted |
"this" being "add I can see where this might be useful, probably on all one-of structs and perhaps on those containing a discriminator because otherwise SSA leaves fields set which should be cleared when some other owner takes over. Is this important enough to put into #125488? I don't see a big need for SSA in general and even less for SSA with different owners at the moment - this will change once we do more with status. |
No, not urgent. This is the first time it has come up in my awareness ever. But now that I know about it, I could see how it applies to dra. |
Thank to everyone involved here to resolve this! This will make things simpler in the Keycloak operator once it is released. |
Thanks for filing a good (and easy to fix :) bug. Easy repro means we can jump on it. |
What happened?
I created an Ingress resource with a port number manually, and then tried to use an Operator with server-side apply to update the resource from a port number to a port name. This failed with the error message "cannot set both port name & port number".
What did you expect to happen?
I expected the port number to be cleared as the operator would take over the ownership of the ServiceBackendPort.
How can we reproduce it (as minimally and precisely as possible)?
To simulate the behavior in the operator in a most simple example I use
kubectl
:ingress-v1.yaml:
ingress-v2.yaml:
This will print:
Anything else we need to know?
It seems to me that the merge type for the struct ServiceBackendPort should to be set to "atomic" according to this doc, so that the Operator updating the port should take over the whole struct, and two applications shouldn't update single fields in it.
kubernetes/staging/src/k8s.io/api/networking/v1/types.go
Lines 523 to 544 in 0cc5725
Kubernetes version
Cloud provider
Red Hat OpenShift on AWS
OS version
OS version of the client:
NAME="Fedora Linux"
VERSION="40 (Workstation Edition)"
Linux fedora.fritz.box 6.9.6-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 21 15:48:21 UTC 2024 x86_64 GNU/Linux
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: