-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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 set --container-runtime-endpoint with prefix 'unix://' #100578
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pacoxu The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Windows:
Unix:
|
54fddd4
to
ace775f
Compare
ace775f
to
8c3edd7
Compare
d6ff5ec
to
75af1f4
Compare
75af1f4
to
f4123ad
Compare
3cc3977
to
37ae668
Compare
37ae668
to
4bd8054
Compare
/test pull-kubernetes-unit |
} | ||
return "npipe", fmt.Sprintf("//%s%s", host, u.Path), nil | ||
} else if u.Scheme == "" { | ||
return "", "", fmt.Errorf("using %q as endpoint is deprecated, please consider using full url format", endpoint) |
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.
but this error is actually breaking to existing users. we should make it a warning like on Linux
https://github.com/kubernetes/kubernetes/pull/100578/files#diff-6a2920d18500a74976b64e8e4a365a296ef20cd168a6bd8712316a400b6eabe0R39-R44
so instead i suggest the following:
- combine isExistingSocket and parseEndpoint
- print warning (like on Linux) for
u.Scheme == ""
and automatically prepend "npipe"
} else if u.Scheme == "" { | ||
return "", "", fmt.Errorf("using %q as endpoint is deprecated, please consider using full url format", endpoint) | ||
} else { | ||
return u.Scheme, "", fmt.Errorf("protocol %q not supported", u.Scheme) |
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.
once you combine isExistingSocket and parseEndpoint, this can be a klog.Warningf and just try to dial the endpoint
_, err := winio.DialPipe(path, nil) | ||
_, dialPath, err := parseEndpoint(path) | ||
if err != nil { | ||
return false |
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 should handle this error with a warning the same way we do for Linux
if err != nil {
klog.Warningf("Could not parse the Windows container runtime endpoint: %v")
return false
}
|
||
return fileInfo.Mode()&os.ModeSocket != 0 | ||
// TODO: remove this warning and Scheme override once paths without scheme are not supported | ||
if u.Scheme == "" { |
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.
should be if u.Scheme != "unix"
?
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.
@pacoxu i had another review pass...i think this still needs some more changes.
if you don't have the time i can take your commit, change it, add Co-authored-by: Paco Xu <email>
and we can close this PR. this will also be easier for me to start working on the other changes. WDYT?
4bd8054
to
dabc720
Compare
dabc720
to
0285bf7
Compare
@neolit123 Ofcouse is OK. Thanks for reviewing. I updated the PR and you can open a new one to close this PR if there are still some pending works and you have time. Thanks. |
@pacoxu: 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 failed for docker shim settings. @neolit123 It seems that you will work on that trick handlings. |
ok, i will send updated PR as soon as possible. we changed the test for flags here for kubelet < 1.24 vs kubelet >= 1.24: |
What type of PR is this?
/kind bug
What this PR does / why we need it:
kubeadm auto-detect the cri like below:
However, kubelet raises a warning
Which issue(s) this PR fixes:
Fixes kubernetes/kubeadm#2426
Special notes for your reviewer:
avoid the warning for
kubeadm + containerd
init/join.similar case:
kubernetes/cluster/gce/config-test.sh
Line 113 in ca91618
Does this PR introduce a user-facing change?