-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Change the order the different versions of API are registered #7629
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
Change the order the different versions of API are registered #7629
Conversation
cc @bgrant0607 |
LGTM |
@@ -73,10 +73,10 @@ func TestInterfacesFor(t *testing.T) { | |||
|
|||
func TestRESTMapper(t *testing.T) { | |||
// TODO: This test does not seem right. The version returned here depends on the order in which API versions were registered. This will just return the API version that was registered first. Fix this. |
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.
You can delete this TODO
dcff196
to
01e91e3
Compare
Hi @smarterclayton, the shippable fails because the test-cmd.sh fails. These lines cause the problem:
It's called when ${version} = "". I think the nil version means the default version, which is now v1beta3. So I guess we should modify the script to skip the minions test when version is nil. Am I right? Thanks. |
Yes. You can change that if condition to
|
Hi @smarterclayton , just out of curious, what does this line do in test-cmd.sh?
Why is there a $ sign before the template "$'{{ .apiVersion }}'"? And where is the test result used? I searched for "$?" but there is none. I know very little about bash.. |
Correct, now that v1beta3 is the default the empty API version will not have minions as the default name.
|
That's a great question I believe that might be the result of a copy and paste bug - I don't think that $ should be there.
|
01e91e3
to
dac9080
Compare
…eferred versions first. This makes kubectl sends requests to URLs in the format defined by the latest API version.
dac9080
to
4787c66
Compare
Hi @smarterclayton, the PR passes the shippable, could you merge it? Thanks. |
Rerunning travis |
LGTM |
Change the order the different versions of API are registered
Register the API versions to the DefaultRESTMapper in the order of preferred versions first.
This makes kubectl sends requests to URLs in the format defined by the latest version of API, thus fixing #7512, #7260, and #7491