Fix webhook config merge to match by name instead of index#1888
Conversation
OpenStackControlPlane CRD Size Report
Threshold reference
|
d5d5d88 to
69824a8
Compare
MergeWebhookConfigurationForUpdate was copying the entire clientConfig from current to updated webhooks by array index. When the webhook arrays have different ordering (e.g. Kubernetes sorts alphabetically by name, but the template YAML has a different order), each webhook gets the clientConfig from the wrong entry. This scrambles the service paths, causing admission requests to be routed to the wrong handler. For example, mrabbitmq-v1beta1.kb.io would get the path for /mutate-network-openstack-org-v1beta1-reservation instead of /mutate-rabbitmq-openstack-org-v1beta1-rabbitmq, resulting in: "unable to decode rabbitmq.openstack.org/v1beta1, Kind=RabbitMq into *v1beta1.Reservation" Fix by matching webhooks by name and only copying the caBundle field (injected by cert-manager) rather than the entire clientConfig. This preserves the correct service path from the updated template. Jira: https://redhat.atlassian.net/browse/OSPRH-29026 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
69824a8 to
cd8350e
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abays, lmiccini The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
looks gook! thanks @lmiccini!! |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/dfd55f523d1c41cd940711cb56151d09 ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 26m 11s |
|
recheck |
b950208
into
openstack-k8s-operators:main
|
/cherry-pick 18.0-fr5 |
|
@lmiccini: new pull request created: #1889 DetailsIn 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. |
MergeWebhookConfigurationForUpdatewas copying the entireclientConfigfrom current to updated webhooks by array index. When the webhook arrays have different ordering (Kubernetes sorts alphabetically by name, but the template YAML has a different order), each webhook gets theclientConfigfrom the wrong entry, scrambling all the service paths.mrabbitmq-v1beta1.kb.iowould get the path for/mutate-network-openstack-org-v1beta1-reservation, resulting in:unable to decode rabbitmq.openstack.org/v1beta1, Kind=RabbitMq into *v1beta1.Reservationnamefield and only copying thecaBundle(injected by cert-manager) rather than the entireclientConfig, preserving the correct service path from the updated template.Jira: https://redhat.atlassian.net/browse/OSPRH-29026