Skip to content

Conversation

@Miciah
Copy link
Contributor

@Miciah Miciah commented Feb 17, 2022

The AWS cloud-provider implementation checks the service.beta.kubernetes.io/aws-load-balancer-internal service annotation to determine whether a service load-balancer (SLB) should be internal. The cloud-provider implementation recognizes both the value "0.0.0.0/0" and the value "true" as indicating that the SLB should be internal. OpenShift 4.7 and earlier use the value "0.0.0.0/0", and OpenShift 4.8 and later use the value "true". A service that was created on an older cluster might have the value "0.0.0.0/0", which can cause comparisons that check for the "true" value to return the wrong result. This PR adds logic to normalize the annotation value to "true".

Follow-up to #543 and to #582.

  • pkg/operator/controller/ingress/load_balancer_service.go (ensureLoadBalancerService): Call the new normalizeLoadBalancerServiceAnnotations method to normalize the AWS internal LB annotation.
    (normalizeLoadBalancerServiceAnnotations): New method. Normalize the service.beta.kubernetes.io/aws-load-balancer-internal service annotation by replacing the value "0.0.0.0/0" with the value "true".
  • test/e2e/operator_test.go (TestInternalLoadBalancer): Verify that the operator updates the old "0.0.0.0/0" annotation value to "true".

The AWS cloud-provider implementation checks the
service.beta.kubernetes.io/aws-load-balancer-internal service annotation
to determine whether a service load-balancer (SLB) should be internal.  The
cloud-provider implementation recognizes both the value "0.0.0.0/0" and the
value "true" as indicating that the SLB should be internal.  OpenShift 4.7
and earlier use the value "0.0.0.0/0", and OpenShift 4.8 and later use the
value "true".  A service that was created on an older cluster might have
the value "0.0.0.0/0", which can cause comparisons that check for the
"true" value to return the wrong result.  This commit adds logic to
normalize the annotation value to "true".

Follow-up to commit 3abcba5
and commit 4cc59f5.

This commit fixes bug 2055470.

https://bugzilla.redhat.com/show_bug.cgi?id=2055470

* pkg/operator/controller/ingress/load_balancer_service.go
(ensureLoadBalancerService): Call the new
normalizeLoadBalancerServiceAnnotations method to normalize the AWS
internal LB annotation.
(normalizeLoadBalancerServiceAnnotations): New method.  Normalize the
service.beta.kubernetes.io/aws-load-balancer-internal service annotation by
replacing the value "0.0.0.0/0" with the value "true".
* test/e2e/operator_test.go (TestInternalLoadBalancer): Verify that the
operator updates the old "0.0.0.0/0" annotation value to "true".
@openshift-ci openshift-ci bot added the bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. label Feb 17, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 17, 2022

@Miciah: This pull request references Bugzilla bug 2055470, which is invalid:

  • expected the bug to target the "4.11.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

Bug 2055470: Normalize the AWS internal LB annotation value

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.

@openshift-ci openshift-ci bot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Feb 17, 2022
@openshift-ci openshift-ci bot requested review from candita and rfredette February 17, 2022 07:00
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 17, 2022
@Miciah
Copy link
Contributor Author

Miciah commented Feb 17, 2022

/bugzilla refresh

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 17, 2022

@Miciah: This pull request references Bugzilla bug 2055470, which is invalid:

  • expected the bug to target the "4.11.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

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
Copy link
Contributor Author

Miciah commented Feb 17, 2022

/bugzilla refresh

@openshift-ci openshift-ci bot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Feb 17, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 17, 2022

@Miciah: This pull request references Bugzilla bug 2055470, 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
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @quarterpin

Details

In response to this:

/bugzilla refresh

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.

@openshift-ci openshift-ci bot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Feb 17, 2022
@openshift-ci openshift-ci bot requested a review from quarterpin February 17, 2022 07:13
@Miciah
Copy link
Contributor Author

Miciah commented Feb 17, 2022

Unfortunately the operator logs start a few minutes after the TestInternalLoadBalancer test ran, so we don't see the "normalized annotation" log entry. However, TestInternalLoadBalancer still passes, and we can see in the test output that it ran the new verification and passed:

=== RUN   TestInternalLoadBalancer
    operator_test.go:835: expected service.beta.kubernetes.io/aws-load-balancer-internal=true, found service.beta.kubernetes.io/aws-load-balancer-internal=0.0.0.0/0
    operator_test.go:844: deleted ingresscontroller test

Let's make sure the test change didn't break other platforms.

/test e2e-azure-operator
/test e2e-gcp-operator

@miheer
Copy link
Contributor

miheer commented Feb 22, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 22, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 22, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Miciah, miheer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


log.Info("normalized annotation", "namespace", service.Namespace, "name", service.Name, "annotation", awsInternalLBAnnotation, "old", v, "new", updated.Annotations[awsInternalLBAnnotation])

return true, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be we shall say return true, err ? anyway the logic will remain same.

@miheer
Copy link
Contributor

miheer commented Feb 22, 2022

/retest

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 22, 2022

@Miciah: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

@openshift-merge-robot openshift-merge-robot merged commit a61f04b into openshift:master Feb 22, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 22, 2022

@Miciah: All pull requests linked via external trackers have merged:

Bugzilla bug 2055470 has been moved to the MODIFIED state.

Details

In response to this:

Bug 2055470: Normalize the AWS internal LB annotation value

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
Copy link
Contributor Author

Miciah commented Feb 22, 2022

/cherry-pick release-4.10

@openshift-cherrypick-robot

@Miciah: new pull request created: #705

Details

In response to this:

/cherry-pick release-4.10

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants