-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Tighten kubectl version check #42600
Conversation
This PR is not for the master branch but does not have the |
/lgtm |
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.
why wouldn't we tightly bound the versions the workaround applies to? (>= 1.4.0, <1.5.0)
Are we also fixing the v0.0.0 issue in head?
c915968
to
8806b36
Compare
Thanks, i updated the code as suggested. Also updated the PR description. PTAL.
i think it has always been like this. Only when we make a release will the version be written to base.go, so it's not a bug. |
I don't think it has always been like that. Building from a branch off of master just before the release-1.5 branch was cut (a3ba760) with a random commit of my own added on top, I get
the issue might be that the build scripts only set vars under
|
pkg/apiserver/apiserver.go
Outdated
// TODO: Remove in 1.6. Returns if kubectl is older than v1.5.0 | ||
func isOldKubectl(userAgent string) bool { | ||
// TODO: Remove in 1.6. Returns if kubectl is older than v1.5.0 and newer than or equal to v1.4.0 | ||
func is14Kubectl(userAgent string) bool { | ||
// example userAgent string: kubectl-1.3/v1.3.8 (linux/amd64) kubernetes/e328d5b |
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.
funnily, the example user agent string no longer passes this function
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 to "1.4". Though as an example it doesn't have to pass the check :)
Thanks @liggitt. Tried the following and the rewrite still doesn't work:
|
8806b36
to
f86eee6
Compare
The go path is k8s.io/kubernetes/vendor/k8s.io/client-go/... building from HEAD with this:
produces
|
opened #42623 with the build fix |
if we get #42623 merged, I don't feel strongly about patching this version check |
@liggitt may i get the lgtm? Thanks. |
in the abstract, the bounded version check LGTM, given the v0.0.0 issue is a bug we can fix, I'm unsure whether it's worth updating the 1.5 release for that |
Hmm, let's still merge this. It's a pure improvement. We might break kubectl again, this pull will save people from debugging the issue again. |
did the previous unbounded check allow kubectl 1.3 to work against 1.5? |
1.5 apiserver will hide the |
so tightening it breaks kubectl 1.3, which is outside our 1 version skew support statement, but makes this not a pure improvement. I could go either way. |
Excuse my English, I used the wrong tense. I mean without the tightening, "1.5 apiserver is hiding the apps and the policy groups from 1.3 kubectl, so 1.3 kubectl apiversions doesn't see those two groups." With the tightening, 1.3 kubectl can see these two groups enabled, though it still cannot do any CRUD operations because the lack of the scheme. So this pull is a pure improvement. |
ok, so 1.4 was the only version that had the "already registered" problem? |
Sorry,1.3 is affected by the "already registered" change, 1.2 is not. We should tighten the version to >=1.3 and <1.5. [update] I've updated the code. (the line caused the bug is merged on Mar. 31, 2016: #18835) |
f86eee6
to
b23acbc
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED The following people have approved this PR: caesarxuchao, foxish, liggitt Needs approval from an approver in each of these OWNERS Files: We suggest the following people: |
@mwielgus I think you are managing the 1.5 branch, could you approve this pr to the 1.5 branch? |
Fix #40813
This let api server apply the workaround added in #35840 only for kubectl version >=1.3.0 and <1.5.0.
Note that if a kubectl is built from a commit between 1.3.0 and 1.50 in the master branch, kubectl will have versionkubectl/v0.0.0
, so the workaround will not be applied and such kubectl will suffer #35791. I think that's a less evil bug than #40813, thus we should merge this pull.