Repository navigation
fix: use omitzero instead of omitempty for supportedKinds to ensure backward compatibility - #4551
Conversation
…ackward compatibility Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
|
/cc @davidjumani @rikatz |
|
/retest |
|
/approve Leaving lgtm for someone else. I agree this is one of those very edge cases on how we test things and how they can be impacted by different assumptions of null vs empty :) |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidjumani, rikatz, snorwin 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 |
|
/cherry-pick release-1.5 |
|
@snorwin: once the present PR merges, I will cherry-pick it on top of 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. |
|
@snorwin: new pull request created: #4556 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. |
…ackward compatibility (kubernetes-sigs#4551) Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
What type of PR is this?
/kind bug
What this PR does / why we need it:
With the 1.5 release, the
supportedKindsfield inListenerStatuswas changed fromrequiredtooptional, andomitemptywas introduced.While this appears to be a non-breaking API change, the addition of
omitemptyeffectively breaks controllers reconciling older versions as soon as the dependency is updated to v1.5. Because the field is no longer explicitly set to an empty value, it may be omitted entirely from the status. However, certain conformance tests, e.g.,GatewayInvalidRouteKind, still expect the field to be present, even if empty.In our case, this resulted in the controller entering an endless reconcile loop with the following error:
1.4.1
https://github.com/kubernetes-sigs/gateway-api/blob/v1.4.1/apis/v1/gateway_types.go#L1310-L1313
v1.5.0-rc.1
https://github.com/kubernetes-sigs/gateway-api/blob/v1.5.0-rc.1/apis/v1/gateway_types.go#L1365-L1368
This PR ensures compatibility by preventing
supportedKindsfrom being omitted in cases where it must be explicitly set empty.Which issue(s) this PR fixes:
N/A
Does this PR introduce a user-facing change?: