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

MULTIARCH-4633: Power VS: Configure load balancers for the private scenario #8331

Merged
merged 1 commit into from May 3, 2024

Conversation

mjturek
Copy link
Contributor

@mjturek mjturek commented Apr 30, 2024

In the private scenario, both api and api-int will point to the private loadbalancer. Update the DNS creation call back to support this.

@mjturek mjturek force-pushed the private-lb branch 5 times, most recently from 0dd50bd to cde97b4 Compare April 30, 2024 20:25
@mjturek mjturek changed the title Power VS: Configure load balancers for the private scenario MULTIARCH-4633: Power VS: Configure load balancers for the private scenario Apr 30, 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 Apr 30, 2024
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Apr 30, 2024

@mjturek: This pull request references MULTIARCH-4633 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 sub-task to target the "4.16.0" version, but no target version was set.

In response to this:

In the private scenario, both api and api-int will point to the private loadbalancer. Update the DNS creation call back to support 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 openshift-eng/jira-lifecycle-plugin repository.

@miyamotoh
Copy link
Contributor

/lgtm

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

mjturek commented Apr 30, 2024

/assign r4f4

// InfraReady is called once cluster.Status.InfrastructureReady
// is true, typically after load balancers have been provisioned. It can be used
// to create DNS records.
// nolint:gocyclo
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the linter has a point here and it's time to start breaking this functionality down into separate functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep I'm working on it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@r4f4 are you okay with me refactoring in this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mjturek sure. Just please break it down into commits to make the life of a fellow reviewer a bit easier :)
I also wouldn't mind if you add the //nolint: now and do the break down in a follow-up (as long as it's done).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good, let me address your other comments and I'll finish up the break down in a follow up patch this week that removes the //nolint:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleanup patch is here #8337 it's based on this one so theoretically we could merge it in one go. Up to you!

Comment on lines 257 to 267
existingSubnets, err := installConfig.PowerVS.GetVPCSubnets(context.TODO(), vpc)
if err != nil {
return err
}
for _, subnet := range existingSubnets {
vpcSubnets = append(vpcSubnets, *subnet.Name)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't these subnets supplied via installConfig.Config.PowerVS.VPCSubnets?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they are but we've found the provider will fail if you don't add all of the existing subnets. We could require that you specify all the subnets through the install config, but this is a more automated approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. Let's add that explanation as a comment here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do!

Comment on lines 196 to 199
if err2 == nil {
return true, nil
}
return false, err2
Copy link
Contributor

Choose a reason for hiding this comment

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

ExponentialBackoff immediately returns an error if the callback returns an error. So this whole backoff call is useless here. You only need it in case you inspect the error and decide to retry the call in certain conditions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the intent here is to wrap a function that returns only error to one that returns bool, error as ExponentialBackoffWithContext wants. We can alter the client functions to return bool, error if you'd like.. Is there something else you're suggesting?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's not what I mean. ExponentialBackoff is to be used when you want to retry a functional call (with exponential backoff). In your case, you're never retrying anything because you either stop after the first success (return true, nil) or you stop with the first failure (return false, err2). You can remove the whole ExponentialBackoff and just call client.CreateDNSRecord and you'll have the exact same behaviour.

So unless there is an error condition when you want to return false, nil, the ExponentialBackoff is useless.

Copy link
Contributor

Choose a reason for hiding this comment

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

https://pkg.go.dev/k8s.io/apimachinery/pkg/util/wait#ExponentialBackoffWithContext

ExponentialBackoffWithContext repeats a condition check with exponential backoff. It immediately returns an error if the condition returns an error, [...]. If an error is returned by the condition the backoff stops immediately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahhhhh I had thought it would retry until returning true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you indeed are right - I've removed the backoff bits.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label May 1, 2024
@mjturek mjturek force-pushed the private-lb branch 2 times, most recently from b5d598f to 6742b73 Compare May 2, 2024 16:14
@mjturek
Copy link
Contributor Author

mjturek commented May 2, 2024

After talking with @r4f4 we decided it would be better to fix the retry rather than remove it!

Copy link
Contributor

@r4f4 r4f4 left a comment

Choose a reason for hiding this comment

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

/approve

Copy link
Contributor

openshift-ci bot commented May 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: r4f4

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 May 2, 2024
@miyamotoh
Copy link
Contributor

/lgtm

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

/retest-required

Remaining retests: 0 against base HEAD adb699e and 2 for PR HEAD 8002370 in total

@mjturek
Copy link
Contributor Author

mjturek commented May 3, 2024

/test e2e-aws-ovn

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 1cb86cb and 1 for PR HEAD 8002370 in total

Copy link
Contributor

openshift-ci bot commented May 3, 2024

@mjturek: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-e2e-aws-ovn-upgrade 8002370 link false /test okd-e2e-aws-ovn-upgrade

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.

@openshift-merge-bot openshift-merge-bot bot merged commit def8d5d into openshift:master May 3, 2024
19 of 20 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-installer-altinfra-container-v4.16.0-202405031950.p0.gdef8d5d.assembly.stream.el9 for distgit ose-installer-altinfra.
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
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.

None yet

5 participants