-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
🐛 KCP: expect timeout from target cluster load-balancer #2409
Conversation
Hi @maelk. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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 might need to be configurable. We might want the controller to fail on timeout for external load-balancers. |
controlplane/kubeadm/controllers/kubeadm_control_plane_controller.go
Outdated
Show resolved
Hide resolved
controlplane/kubeadm/controllers/kubeadm_control_plane_controller.go
Outdated
Show resolved
Hide resolved
controlplane/kubeadm/controllers/kubeadm_control_plane_controller.go
Outdated
Show resolved
Hide resolved
/ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: detiber, maelk 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 |
/hold |
/hold cancel |
|
||
remoteClient, err := r.remoteClientGetter(ctx, r.Client, util.ObjectKey(cluster), r.scheme) | ||
if err != nil && !apierrors.IsNotFound(errors.Cause(err)) { | ||
if err != nil && !apierrors.IsNotFound(errors.Cause(err)) && !apierrors.IsTimeout(errors.Cause(err)) { | ||
return errors.Wrap(err, "failed to create remote cluster client") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this space for readability
|
||
remoteClient, err := r.remoteClientGetter(ctx, r.Client, util.ObjectKey(cluster), r.scheme) | ||
if err != nil && !apierrors.IsNotFound(errors.Cause(err)) { | ||
if err != nil && !apierrors.IsNotFound(errors.Cause(err)) && !apierrors.IsTimeout(errors.Cause(err)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have only if err != nil
here, we can use a simple else
condition for the range
.
Inside the if err != nil
block we can also do
if cause := errors.Cause(err); !apierrors.IsNotFound(cause) && !apierrors.IsTimeout(cause) {
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thank you
in case it is a self-hosted control-plane load-balancer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
What this PR does / why we need it:
This PR adds a condition for Kubeadm Control Plane Controller to not fail if getting a timeout from the load-balancer in case it is self-hosted in the target cluster (and does not answer while the first node is not up
Which issue(s) this PR fixes :
Fixes #2408