mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 13:31:52 +00:00
only construct shortcutmapper when we have the discovery client
This commit is contained in:
parent
7d4383c6e1
commit
9b5acdbb88
@ -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