-
Notifications
You must be signed in to change notification settings - Fork 460
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
expectedServices function not copying desired spec #256
Comments
From what I remember, we can't simply copy the Spec, as the clusterIP has to either be empty or None. The service controller will then change the value to a real IP if it's empty, and an update of this resource will fail if we specify the IP ourselves. So, I prefer to cherry-pick the properties that we want to override. |
Yep. I forgot about Cluster IP. we cant copy the whole spec. But I think we should copy spec.Ports atleast - or else we would miss out on any new ports added |
Could you clarify on "ports added"? Do you mean that users might add ports to a service? |
I meant some one can add a new receiver in opentelemetry collector CR config or a new port in CR spec.ports |
Right, the new desired ports should override the current list of ports. |
Yep :). |
Should we only copy the ports? Otherwise, which fields of the Service spec would we wish to copy? |
Here are the reference docs for the Service object. I think copying the ports should be sufficient, but review it as well and see if you have another suggestion. https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#service-v1-core |
opentelemetry-operator/pkg/collector/reconcile/service.go
Lines 182 to 199 in db40230
I guess, we should be copying desired.Spec to updated.Spec if I am not wrong. -
If we dont do that service spec wont be updated if some one adds a new receiver in config or explicit port in Spec.Ports of collector.
The text was updated successfully, but these errors were encountered: