mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Merge pull request #41570 from deads2k/cli-03-tolerate-missing-shortcut
Automatic merge from submit-queue only construct shortcutmapper when we have the discovery client Resource shortnames come from the discoveryclient, so we should only wrap with that mapper when we have the information we need.
This commit is contained in:
commit
f0b58a7bed
@ -72,11 +72,12 @@ func (f *ring1Factory) Object() (meta.RESTMapper, runtime.ObjectTyper) {
|
||||
api.Registry.RESTMapper(), // hardcoded fall back
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// wrap with shortcuts
|
||||
mapper, err = NewShortcutExpander(mapper, discoveryClient)
|
||||
CheckErr(err)
|
||||
// wrap with shortcuts, they require a discoveryClient
|
||||
mapper, err = NewShortcutExpander(mapper, discoveryClient)
|
||||
// you only have an error on missing discoveryClient, so this shouldn't fail. Check anyway.
|
||||
CheckErr(err)
|
||||
}
|
||||
|
||||
// wrap with output preferences
|
||||
cfg, err := f.clientAccessFactory.ClientConfigForVersion(nil)
|
||||
|
Loading…
Reference in New Issue
Block a user