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
Bug 2002461: serviceChanged: Fix internalTrafficPolicy #294
Bug 2002461: serviceChanged: Fix internalTrafficPolicy #294
Conversation
When comparing services to determine whether an update is required, treat the empty value and default value for spec.internalTrafficPolicy as equal. Before this commit, the update logic would keep trying to revert the default value that the API set for the service's internal traffic policy. The spec.internalTrafficPolicy field is newly enabled in Kubernetes 1.22 (OpenShift 4.9). This commit fixes bug 2002461. https://bugzilla.redhat.com/show_bug.cgi?id=2002461 * pkg/operator/controller/controller_dns_service.go (serviceChanged): Use the new cmpServiceInternalTrafficPolicyType function so that two services are considered equal if the only difference between them is that one does not specify internal traffic policy and the other service has the default value. (cmpServiceInternalTrafficPolicyType): New function. * pkg/operator/controller/controller_dns_service_test.go (TestDNSServiceChanged): Verify that serviceChanged returns false if the only mutation is that the internal traffic policy has been updated from empty to the default value.
@Miciah: This pull request references Bugzilla bug 2002461, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: 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. |
/cherry-pick release-4.9 |
@Miciah: once the present PR merges, I will cherry-pick it on top of release-4.9 in a new PR and assign it to you. 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. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: frobware, Miciah The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@Miciah: All pull requests linked via external trackers have merged: Bugzilla bug 2002461 has been moved to the MODIFIED state. 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. |
@Miciah: new pull request created: #295 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. |
When comparing services to determine whether an update is required, treat the empty value and default value for
spec.internalTrafficPolicy
as equal.Before this change, the update logic would keep trying to revert the default value that the API set for the service's internal traffic policy.
The
spec.internalTrafficPolicy
field is newly enabled in Kubernetes 1.22 (OpenShift 4.9).pkg/operator/controller/controller_dns_service.go
(serviceChanged
): Use the newcmpServiceInternalTrafficPolicyType
function so that two services are considered equal if the only difference between them is that one does not specify internal traffic policy and the other service has the default value.(
cmpServiceInternalTrafficPolicyType
): New function.pkg/operator/controller/controller_dns_service_test.go
(TestDNSServiceChanged
): Verify thatserviceChanged
returns false if the only mutation is that the internal traffic policy has been updated from empty to the default value.