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
[release-4.9] Bug 2097736: Fix loadBalancerServiceAnnotationsChanged check and update #786
[release-4.9] Bug 2097736: Fix loadBalancerServiceAnnotationsChanged check and update #786
Conversation
Fix loadBalancerServiceAnnotationsChanged to use the provided "annotations" argument when updating annotations. Before this commit, loadBalancerServiceAnnotationsChanged used the annotations argument when checking whether annotations had changed, but then it used managedLoadBalancerServiceAnnotations when setting the annotations in the updated service object. When checking whether the service is upgradeable for the purpose of setting the ingresscontroller's "Upgradeable" status condition, loadBalancerServiceTagsModified calls loadBalancerServiceAnnotationsChanged with an annotations argument that includes the "service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags" annotation key, which is not in managedLoadBalancerServiceAnnotations. As a result, loadBalancerServiceAnnotationsChanged would report that the service was not upgradeable, but then the status condition message would not show that the "aws-load-balancer-additional-resource-tags" annotation had changed. * pkg/operator/controller/ingress/load_balancer_service.go (loadBalancerServiceAnnotationsChanged): Use the provided annotations argument instead of using managedLoadBalancerServiceAnnotations when updating annotations. * pkg/operator/controller/ingress/load_balancer_service_test.go (TestLoadBalancerServiceAnnotationsChanged): New test. Verify that loadBalancerServiceAnnotationsChanged behaves correctly when an unmanaged annotation is updated or when a managed annotation is added, updated, or deleted.
Fix loadBalancerServiceAnnotationsChanged to treat nil and empty annotations maps as equal. Before this commit, the comparison erroneously flagged an empty map and a nil map as unequal. As a result, the ingress operator could erroneously report that an ingresscontroller with a service with no annotations was not upgradeable. This commit fixes bug 2097555. https://bugzilla.redhat.com/show_bug.cgi?id=2097555 * pkg/operator/controller/ingress/load_balancer_service.go (loadBalancerServiceAnnotationsChanged): Use a for loop instead of go-cmp to check whether any managed annotations have changed. * pkg/operator/controller/ingress/load_balancer_service_test.go (TestLoadBalancerServiceAnnotationsChanged): Add test cases for empty/nil current/expected annotations.
@Miciah: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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: candita, 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 |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/test e2e-aws-operator |
@Miciah: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
/label backport-risk-assessed |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/label cherry-pick-approved |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 2097736, which is invalid:
Comment 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. |
/bugzilla refresh |
@wking: This pull request references Bugzilla bug 2097736, which is valid. 6 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. |
@Miciah: All pull requests linked via external trackers have merged: Bugzilla bug 2097736 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. |
This is a manual cherry-pick of #783. #707 introduced a conflict that required resolution.
loadBalancerServiceAnnotationsChanged
: Fix updateFix
loadBalancerServiceAnnotationsChanged
to use the providedannotations
argument when updating annotations. Before this change,loadBalancerServiceAnnotationsChanged
used theannotations
argument when checking whether annotations had changed, but then it usedmanagedLoadBalancerServiceAnnotations
when setting the annotations in the updated service object.When checking whether the service is upgradeable for the purpose of setting the ingresscontroller's "Upgradeable" status condition,
loadBalancerServiceTagsModified
callsloadBalancerServiceAnnotationsChanged
with anannotations
argument that includes the "service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags" annotation key, which is not inmanagedLoadBalancerServiceAnnotations
. As a result,loadBalancerServiceAnnotationsChanged
would report that the service was not upgradeable, but then the status condition message would not show that the "aws-load-balancer-additional-resource-tags" annotation had changed.pkg/operator/controller/ingress/load_balancer_service.go
(loadBalancerServiceAnnotationsChanged
): Use the providedannotations
argument instead of usingmanagedLoadBalancerServiceAnnotations
when updating annotations.pkg/operator/controller/ingress/load_balancer_service_test.go
(TestLoadBalancerServiceAnnotationsChanged
): New test. Verify thatloadBalancerServiceAnnotationsChanged
behaves correctly when an unmanaged annotation is updated or when a managed annotation is added, updated, or deleted.loadBalancerServiceAnnotationsChanged
: Fix checkFix
loadBalancerServiceAnnotationsChanged
to treat nil and empty annotations maps as equal. Before this commit, the comparison erroneously flagged an empty map and a nil map as unequal. As a result, the ingress operator could erroneously report that an ingresscontroller with a service with no annotations was not upgradeable.pkg/operator/controller/ingress/load_balancer_service.go
(loadBalancerServiceAnnotationsChanged
): Use afor
loop instead of go-cmp to check whether any managed annotations have changed.pkg/operator/controller/ingress/load_balancer_service_test.go
(TestLoadBalancerServiceAnnotationsChanged
): Add test cases for empty/nil current/expected annotations.