v1beta1 should return Minion as kind, rather than Node

This changes the internal name logic (for conversion) to prefer the
internal registered preferred name for a resource, and then makes
v1beta1 and v1beta2 prefer Minion.

Fixes #3010
This commit is contained in:
Clayton Coleman
2014-12-17 19:55:56 -05:00
parent edfae8660e
commit 7fde4583f2
6 changed files with 66 additions and 15 deletions

View File

@@ -74,6 +74,12 @@ func (s *Scheme) EncodeToVersion(obj interface{}, destVersion string) (data []by
obj = objOut
}
// ensure the output object name comes from the destination type
_, objKind, err = s.ObjectVersionAndKind(obj)
if err != nil {
return nil, err
}
// Version and Kind should be set on the wire.
err = s.SetVersionAndKind(destVersion, objKind, obj)
if err != nil {