Merge pull request #26007 from smarterclayton/watch_opt

Automatic merge from submit-queue

Additional optimizations to the encode/decode paths

Builds on top of #25983 with a number of other optimizations.
This commit is contained in:
k8s-merge-robot
2016-05-28 06:27:00 -07:00
44 changed files with 238 additions and 244 deletions

View File

@@ -365,10 +365,11 @@ func ExternalGroupVersions() []unversioned.GroupVersion {
// Get codec based on runtime.Object
func GetCodecForObject(obj runtime.Object) (runtime.Codec, error) {
kind, err := api.Scheme.ObjectKind(obj)
kinds, _, err := api.Scheme.ObjectKinds(obj)
if err != nil {
return nil, fmt.Errorf("unexpected encoding error: %v", err)
}
kind := kinds[0]
for _, group := range Groups {
if group.GroupVersion().Group != kind.Group {