Skip to content
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

CORS-3755: AWS: Add Ingress LB IPs to Infra CR when in-cluster DNS is enabled #1167

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

sadasu
Copy link
Contributor

@sadasu sadasu commented Nov 19, 2024

Add Ingress LB IPs to Infra CR and set DNS unmanaged when BYO DNS is enabled on the AWS platform.

Replicating the changes added for GCP as part of #1016 for the AWS platform.

@openshift-ci openshift-ci bot requested review from gcs278 and knobunc November 19, 2024 23:25
@sadasu sadasu changed the title AWS: Add Ingress LB IPs to Infra CR and set DNS unmanaged when BYO DNS is enabled CORS-3755: AWS: Add Ingress LB IPs to Infra CR and set DNS unmanaged when BYO DNS is enabled Nov 19, 2024
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 19, 2024
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 19, 2024

@sadasu: This pull request references CORS-3755 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

Replicating the changes added as part of #1016 for the AWS platform.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 19, 2024

@sadasu: This pull request references CORS-3755 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

Add Ingress LB IPs to Infra CR and set DNS unmanaged when BYO DNS is enabled on the AWS platform.

Replicating the changes added as part of #1016 for the AWS platform.

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 openshift-eng/jira-lifecycle-plugin repository.

@sadasu sadasu changed the title CORS-3755: AWS: Add Ingress LB IPs to Infra CR and set DNS unmanaged when BYO DNS is enabled CORS-3755: AWS: Add Ingress LB IPs to Infra CR when in-cluster DNS is enabled Nov 19, 2024
@sadasu
Copy link
Contributor Author

sadasu commented Nov 19, 2024

@gcs278, @candita could you PTAL? You had reviewed similar changes for the GCP platform.

This feature is in tech preview in 4.18.

@sadasu
Copy link
Contributor Author

sadasu commented Nov 20, 2024

/retest-required

Copy link
Contributor

@gcs278 gcs278 left a comment

Choose a reason for hiding this comment

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

Started review, but I have a concern that should be addressed before moving.

pkg/operator/controller/ingress/controller.go Show resolved Hide resolved
pkg/operator/controller/ingress/controller.go Outdated Show resolved Hide resolved
@sadasu
Copy link
Contributor Author

sadasu commented Nov 20, 2024

/test e2e-hypershift

@gcs278
Copy link
Contributor

gcs278 commented Nov 21, 2024

/assign

@sadasu
Copy link
Contributor Author

sadasu commented Nov 21, 2024

/retest-required

@sadasu
Copy link
Contributor Author

sadasu commented Nov 21, 2024

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Nov 21, 2024
@sadasu sadasu force-pushed the aws-custom-dns branch 2 times, most recently from 265ef77 to 90693b7 Compare November 21, 2024 17:30
@gcs278
Copy link
Contributor

gcs278 commented Nov 21, 2024

@sadasu Do you mind putting a link to https://issues.redhat.com//browse/CORS-3755 in your second commit (the actual implementation)? Just a convenience for those trying to find the history.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 21, 2024

@sadasu: This pull request references CORS-3755 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

Add Ingress LB IPs to Infra CR and set DNS unmanaged when BYO DNS is enabled on the AWS platform.

Replicating the changes added for GCP as part of #1016 for the AWS platform.

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 openshift-eng/jira-lifecycle-plugin repository.

Comment on lines 1809 to 1817
if len(ingress.IP) > 0 {
if !slices.Contains(infraConfig.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs, configv1.IP(ingress.IP)) {
t.Errorf("expected Infra CR to contain %s", ingress.IP)
if !reflect.DeepEqual(infraConfig.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs, tc.expectedLBIPs) {
t.Errorf("expected Infra CR to contain %s but found %s", tc.expectedLBIPs, infraConfig.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs)
}
}
if len(ingress.Hostname) > 0 {
if !reflect.DeepEqual(infraConfig.Status.PlatformStatus.AWS.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs, tc.expectedLBIPs) {
t.Errorf("expected Infra CR to contain %s but found %s", tc.expectedLBIPs, infraConfig.Status.PlatformStatus.AWS.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs)
}
Copy link
Contributor

@gcs278 gcs278 Nov 21, 2024

Choose a reason for hiding this comment

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

Instead of using the status.loadBalancer.ingress.[ip|hostname] to determine the platform, consider just using the platform provided in the test case. When we expand this to azure, this will have to be refactored because both GCP and Azure use ingress.IP.

Also, this code is somewhat confusing. We loop through each of the status.loadBalancer.ingress, but then in the reflect.DeepEqual we don't use the ingress variable. I don't think we need to check if len(ingress.IP) > 0 {, we can let the test compare if IngressLoadBalancerIPs and tc.expectedLBIPs are both nil too for better coverage (making sure it doesn't add an unwanted IP).

Suggested change
if len(ingress.IP) > 0 {
if !slices.Contains(infraConfig.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs, configv1.IP(ingress.IP)) {
t.Errorf("expected Infra CR to contain %s", ingress.IP)
if !reflect.DeepEqual(infraConfig.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs, tc.expectedLBIPs) {
t.Errorf("expected Infra CR to contain %s but found %s", tc.expectedLBIPs, infraConfig.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs)
}
}
if len(ingress.Hostname) > 0 {
if !reflect.DeepEqual(infraConfig.Status.PlatformStatus.AWS.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs, tc.expectedLBIPs) {
t.Errorf("expected Infra CR to contain %s but found %s", tc.expectedLBIPs, infraConfig.Status.PlatformStatus.AWS.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs)
}
if updated {
switch tc.platform.Type {
case configv1.AWSPlatformType:
if !reflect.DeepEqual(infraConfig.Status.PlatformStatus.AWS.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs, tc.expectedLBIPs) {
t.Errorf("expected Infra CR to contain %s but found %s", tc.expectedLBIPs, infraConfig.Status.PlatformStatus.AWS.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs)
}
case configv1.GCPPlatformType:
if !reflect.DeepEqual(infraConfig.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs, tc.expectedLBIPs) {
t.Errorf("expected Infra CR to contain %s but found %s", tc.expectedLBIPs, infraConfig.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.ClusterHosted.IngressLoadBalancerIPs)
}
}
}

Let me know if that makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes to both. Updated.

@gcs278
Copy link
Contributor

gcs278 commented Nov 21, 2024

Thanks for the quick responses. I discussed with the team today, and we acknowledged the disadvantage of manually resolving the AWS load balancer hostname, but since this is restricted to tech preview, it's okay to move forward with this. Hopefully we can find a better design, but we will see how it works in tech preview.

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 21, 2024
Copy link
Contributor

openshift-ci bot commented Nov 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gcs278

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 21, 2024
@sadasu
Copy link
Contributor Author

sadasu commented Nov 21, 2024

/label acknowledge-critical-fixes-only

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 0b561f8 and 2 for PR HEAD 0663c8c in total

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 22, 2024
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 22, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 22, 2024
@sadasu sadasu force-pushed the aws-custom-dns branch 2 times, most recently from c292a36 to 8bca4db Compare November 22, 2024 02:46
Also set DNSManagementPolicy to Unmanaged when BYO DNS is enabled
Implementation for https://issues.redhat.com//browse/CORS-3755
Add tests to verify value of EndpointPublishingStrategy on AWS
platform when BYO DNS is enabled.
Add tests for the AWS Platform where the Ingress LB's Hostname is
available but the Infra CR needs to be updated with its IP.
@gcs278
Copy link
Contributor

gcs278 commented Nov 22, 2024

Not totally sure how we usually handle go vendor pruning updates, I noticed your first commit fails make test because it's removing vendored files still in use.

In this scenario, I think the vendoring update should actually be co-located with the commit that removed the import for "golang.org/x/exp/slices", so no commit is "broken". Feel free to fix it, but I don't think it's worth holding up the PR.

/lgtm

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

/retest-required

Remaining retests: 0 against base HEAD fb5c5d3 and 2 for PR HEAD a8096c0 in total

@sadasu
Copy link
Contributor Author

sadasu commented Nov 22, 2024

/retest-required

@sadasu
Copy link
Contributor Author

sadasu commented Nov 22, 2024

Not totally sure how we usually handle go vendor pruning updates, I noticed your first commit fails make test because it's removing vendored files still in use.

In this scenario, I think the vendoring update should actually be co-located with the commit that removed the import for "golang.org/x/exp/slices", so no commit is "broken". Feel free to fix it, but I don't think it's worth holding up the PR.

/lgtm

Yes, the 1st commit is changing the imports requiring the vendoring updates. Sorry, I was following the installer team convention of separating out the vendoring changes into its own commit.

@sadasu
Copy link
Contributor Author

sadasu commented Nov 22, 2024

/test e2e-aws-ovn-upgrade

Copy link
Contributor

openshift-ci bot commented Nov 22, 2024

@sadasu: 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-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 8be1749 into openshift:master Nov 22, 2024
18 checks passed
@sadasu
Copy link
Contributor Author

sadasu commented Nov 22, 2024

/cherry-pick release-4.18

I think this landed shortly after automatic forwarding of release-4.18 to master stopped. So, initiating a backport to release-4.18.

@openshift-cherrypick-robot

@sadasu: new pull request created: #1168

In response to this:

/cherry-pick release-4.18

I think this landed shortly after automatic forwarding of release-4.18 to master stopped. So, initiating a backport to release-4.18.

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.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-cluster-ingress-operator
This PR has been included in build ose-cluster-ingress-operator-container-v4.19.0-202411221708.p0.g8be1749.assembly.stream.el9.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants