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
kubeadm: fix a regression in "kubeadm init" where --kubeconfig is ignored #122735
kubeadm: fix a regression in "kubeadm init" where --kubeconfig is ignored #122735
Conversation
Hi @avorima. Thanks for your PR. I'm waiting for a kubernetes 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. |
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.
/hold for review
/cc @SataQiu
/ok-to-test
cmd/kubeadm/app/cmd/init_test.go
Outdated
// This only works if the client that is constructed from the kubeconfig is not used. | ||
if _, err := data.Client(); err != nil { | ||
t.Fatalf("data.Client returned unexpected error: %v", 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.
can we actually verify that the initOptions.kubeconfigPath is used here?
one way would be with httptest, i guess.
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.
something like this?
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodHead {
w.WriteHeader(http.StatusMethodNotAllowed)
}
}))
defer ts.Close()
...
result := client.Discovery().RESTClient().Verb("HEAD").Do(context.Background())
if err := result.Error(); err != nil {
t.Fatalf("REST client request returned unexpected error: %v", 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.
SGTM!
(please keep the commits squashed to 1)
/triage accepted |
/release-note-edit
|
/uncc @chendave |
please squash the commits to 1 leaving LGTM to @SataQiu |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: avorima, neolit123 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 |
Don't create admin rolebindings when --kubeconfig is set to a non-default value. Fixes: kubernetes/kubeadm#2992 Signed-off-by: Mario Valderrama <mario.valderrama@ionos.com>
bd93050
to
dcdfd71
Compare
/retitle kubeadm: fix a regression in "kubeadm init" where --kubeconfig is ignored |
I suppose this change won't make it into 1.29.1, right? @neolit123 @SataQiu |
no, we missed the deadline last friday. |
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
let's go ahead and merge this.
it can catch the next cherry pick deadline
https://kubernetes.io/releases/patch-releases/#upcoming-monthly-releases
@avorima
would you like to send the cherry pick for release-1.29
as well?
you can try https://github.com/kubernetes/kubernetes/blob/master/hack/cherry_pick_pull.sh
if not a manual cherry pick PR can work too.
LGTM label has been added. Git tree hash: e56cdeb6ce3d57987755569b24c0dc84eea1214b
|
/hold cancel |
sure, i'll do the cherry pick |
Thanks for the PR, please update the release note with the minor version the regression was introduced (for example, "fixes a 1.29 regression…") |
And update the release note in the cherry-pick(s) as well |
@liggitt Thanks for you feedback. I updated both release notes |
…735-upstream-release-1.29 Automated cherry pick of #122735: Fix kubeadm init regression
What type of PR is this?
/kind bug
/kind regression
What this PR does / why we need it:
Don't create admin rolebindings when
--kubeconfig
is set to a non-default value.This allows
kubeadm init
to be invoked with a custom kubeconfig again.Which issue(s) this PR fixes:
Fixes kubernetes/kubeadm#2992
Special notes for your reviewer:
I built and tested the kubeadm binary.
@neolit123
Does this PR introduce a user-facing change?