mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 05:01:46 +00:00
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:
@@ -72,14 +72,21 @@ func (s *Scheme) Log(l DebugLogger) {
|
||||
s.converter.Debug = l
|
||||
}
|
||||
|
||||
// nameFunc returns the name of the type that we wish to use for encoding. Defaults to
|
||||
// the go name of the type if the type is not registered.
|
||||
// nameFunc returns the name of the type that we wish to use to determine when two types attempt
|
||||
// a conversion. Defaults to the go name of the type if the type is not registered.
|
||||
func (s *Scheme) nameFunc(t reflect.Type) string {
|
||||
// find the preferred names for this type
|
||||
names, ok := s.typeToKind[t]
|
||||
if !ok {
|
||||
return t.Name()
|
||||
}
|
||||
if internal, ok := s.versionMap[""]; ok {
|
||||
for _, name := range names {
|
||||
if t, ok := internal[name]; ok {
|
||||
return s.typeToKind[t][0]
|
||||
}
|
||||
}
|
||||
}
|
||||
return names[0]
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user