-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
⚠️ Set user agent and timeout for remote cluster client #4060
⚠️ Set user agent and timeout for remote cluster client #4060
Conversation
/cc @fabriziopandini |
controllers/remote/cluster.go
Outdated
@@ -26,6 +27,11 @@ import ( | |||
"sigs.k8s.io/controller-runtime/pkg/client" | |||
) | |||
|
|||
const ( | |||
defaultClientTimeout = 10 * time.Second | |||
remoteClusterUserAgent = "remote-cluster" |
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.
We might want to build something like https://github.com/kubernetes/client-go/blob/9761a13537eb881bb91c13819ba223eda84ac0af/rest/config.go#L463-L477
but specific to Cluster API?
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.
So instead of something like kubernetes/
we could have cluster.x-k8s.io/
for example?
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.
ok cool, I can do that
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.
+1, it might be good to also have a component that is defined at initialization time. That way we could differentiate which component is using the remote client, which could potentially be different controllers or even different controller managers
6b7ab1d
to
ec6570f
Compare
ec6570f
to
e127b3a
Compare
/test pull-cluster-api-test-main |
/test pull-cluster-api-test-main is there any chance this is a flake? |
894f33c
to
8258eec
Compare
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
/assign @CecileRobertMichon @detiber
/milestone v0.4.0 |
8258eec
to
f1eb9cf
Compare
func NewClusterClient(ctx context.Context, sourceName string, c client.Client, cluster client.ObjectKey) (client.Client, error) { | ||
restConfig, err := RESTConfig(ctx, sourceName, c, cluster) |
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.
These changes make the PR a breaking change
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.
so are you saying we should not do that? or document it? I didn't how else to identity the base component calling
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.
I was waiting if see if reviewers think this approach is good before updating the PR description to say its breaking
@detiber is that more in the direction you had in mind?
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.
Mostly document it
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.
This also means this PR should not be backported to 0.3 (not sure if there were plans to)
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.
I don't think there are any plans to back port this one
/test pull-cluster-api-test-main |
/test pull-cluster-api-apidiff-main |
/test pull-cluster-api-test-main |
f1eb9cf
to
b6036cf
Compare
/test pull-cluster-api-test-main |
3 similar comments
/test pull-cluster-api-test-main |
/test pull-cluster-api-test-main |
/test pull-cluster-api-test-main |
I'm not sure, in my analysis of recent failures, I don't remember other cases of errors in the path helper tests. /test pull-cluster-api-test-main |
its been occasionally passing with me changing anything, but will take another look |
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
/assign @detiber
@detiber any comments? Thanks |
@@ -266,7 +266,7 @@ func (r *KubeadmConfigReconciler) refreshBootstrapToken(ctx context.Context, con | |||
log := ctrl.LoggerFrom(ctx) | |||
token := config.Spec.JoinConfiguration.Discovery.BootstrapToken.Token | |||
|
|||
remoteClient, err := r.remoteClientGetter(ctx, r.Client, util.ObjectKey(cluster)) | |||
remoteClient, err := r.remoteClientGetter(ctx, "kubeadmconfig-controller", r.Client, util.ObjectKey(cluster)) |
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.
can this be a const?
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.
same comment for all other source names
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.
updated all of the names to const
b6036cf
to
b6fa994
Compare
b6fa994
to
3bcf832
Compare
/test pull-cluster-api-e2e-main |
/retest |
@nader-ziada: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
/test pull-cluster-api-e2e-main |
@CecileRobertMichon I think its ready now, there was some flakes with the tests last night, but now seems fine, PTAL. Thanks |
Apologies for the delay |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #2993