-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Avoid double decoding all client responses #36001
Merged
k8s-github-robot
merged 5 commits into
kubernetes:master
from
smarterclayton:change_double_decode
Nov 2, 2016
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ce187f9
Avoid double decoding all client responses
smarterclayton f0fa26b
ExportOptions should be registered to all public schemas
smarterclayton 8987019
Improve the common kinds API test to catch more errors
smarterclayton 95116c7
Authorization should be registered in testapi
smarterclayton 0513826
Unversioned types should decode no matter what the requested version is
smarterclayton File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ import ( | |
"k8s.io/kubernetes/pkg/api/unversioned" | ||
"k8s.io/kubernetes/pkg/apimachinery/registered" | ||
"k8s.io/kubernetes/pkg/apis/apps" | ||
"k8s.io/kubernetes/pkg/apis/authorization" | ||
"k8s.io/kubernetes/pkg/apis/autoscaling" | ||
"k8s.io/kubernetes/pkg/apis/batch" | ||
"k8s.io/kubernetes/pkg/apis/certificates" | ||
|
@@ -66,18 +67,19 @@ import ( | |
) | ||
|
||
var ( | ||
Groups = make(map[string]TestGroup) | ||
Default TestGroup | ||
Autoscaling TestGroup | ||
Batch TestGroup | ||
Extensions TestGroup | ||
Apps TestGroup | ||
Policy TestGroup | ||
Federation TestGroup | ||
Rbac TestGroup | ||
Certificates TestGroup | ||
Storage TestGroup | ||
ImagePolicy TestGroup | ||
Groups = make(map[string]TestGroup) | ||
Default TestGroup | ||
Authorization TestGroup | ||
Autoscaling TestGroup | ||
Batch TestGroup | ||
Extensions TestGroup | ||
Apps TestGroup | ||
Policy TestGroup | ||
Federation TestGroup | ||
Rbac TestGroup | ||
Certificates TestGroup | ||
Storage TestGroup | ||
ImagePolicy TestGroup | ||
|
||
serializer runtime.SerializerInfo | ||
storageSerializer runtime.SerializerInfo | ||
|
@@ -258,6 +260,15 @@ func init() { | |
externalTypes: api.Scheme.KnownTypes(externalGroupVersion), | ||
} | ||
} | ||
if _, ok := Groups[authorization.GroupName]; !ok { | ||
externalGroupVersion := unversioned.GroupVersion{Group: authorization.GroupName, Version: registered.GroupOrDie(authorization.GroupName).GroupVersion.Version} | ||
Groups[authorization.GroupName] = TestGroup{ | ||
externalGroupVersion: externalGroupVersion, | ||
internalGroupVersion: authorization.SchemeGroupVersion, | ||
internalTypes: api.Scheme.KnownTypes(authorization.SchemeGroupVersion), | ||
externalTypes: api.Scheme.KnownTypes(externalGroupVersion), | ||
} | ||
} | ||
if _, ok := Groups[kubeadm.GroupName]; !ok { | ||
externalGroupVersion := unversioned.GroupVersion{Group: kubeadm.GroupName, Version: registered.GroupOrDie(kubeadm.GroupName).GroupVersion.Version} | ||
Groups[kubeadm.GroupName] = TestGroup{ | ||
|
@@ -279,6 +290,7 @@ func init() { | |
Rbac = Groups[rbac.GroupName] | ||
Storage = Groups[storage.GroupName] | ||
ImagePolicy = Groups[imagepolicy.GroupName] | ||
Authorization = Groups[authorization.GroupName] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If nobody uses this, don't add it. We want less code to touch for each group you add, not more. |
||
} | ||
|
||
func (g TestGroup) ContentConfig() (string, *unversioned.GroupVersion, runtime.Codec) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It'd be nice to have a unit test somewhere that makes sure this parallel registration stays in sync.