remove todo: switch UpdatePodSpecForObject to work on v1.PodSpec, use info.VersionedObject, and avoid conversion completely

This commit is contained in:
zhengjiajin
2017-11-11 02:36:12 +08:00
parent 4793b714d8
commit dc312142ab
21 changed files with 1525 additions and 228 deletions

View File

@@ -125,8 +125,13 @@ func (f *ring2Factory) PrintObject(cmd *cobra.Command, isLocal bool, mapper meta
if err != nil {
return err
}
// Prefer the existing external version if specified
var preferredVersion []string
if gvks[0].Version != "" && gvks[0].Version != runtime.APIVersionInternal {
preferredVersion = []string{gvks[0].Version}
}
mapping, err := mapper.RESTMapping(gvks[0].GroupKind())
mapping, err := mapper.RESTMapping(gvks[0].GroupKind(), preferredVersion...)
if err != nil {
return err
}