mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-31 23:00:26 +00:00
ResettableRESTMapper to make it possible to reset wrapped mappers
Kubernetes-commit: de4598d0db5e2babe89dd334407b2ba8024ec9a1
This commit is contained in:
parent
e2c9d634d6
commit
c5a1393028
@ -335,4 +335,4 @@ func (d *DeferredDiscoveryRESTMapper) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure it satisfies the interface
|
// Make sure it satisfies the interface
|
||||||
var _ meta.RESTMapper = &DeferredDiscoveryRESTMapper{}
|
var _ meta.ResettableRESTMapper = &DeferredDiscoveryRESTMapper{}
|
||||||
|
@ -34,7 +34,7 @@ type shortcutExpander struct {
|
|||||||
discoveryClient discovery.DiscoveryInterface
|
discoveryClient discovery.DiscoveryInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ meta.RESTMapper = &shortcutExpander{}
|
var _ meta.ResettableRESTMapper = shortcutExpander{}
|
||||||
|
|
||||||
// NewShortcutExpander wraps a restmapper in a layer that expands shortcuts found via discovery
|
// NewShortcutExpander wraps a restmapper in a layer that expands shortcuts found via discovery
|
||||||
func NewShortcutExpander(delegate meta.RESTMapper, client discovery.DiscoveryInterface) meta.RESTMapper {
|
func NewShortcutExpander(delegate meta.RESTMapper, client discovery.DiscoveryInterface) meta.RESTMapper {
|
||||||
@ -164,6 +164,10 @@ func (e shortcutExpander) expandResourceShortcut(resource schema.GroupVersionRes
|
|||||||
return resource
|
return resource
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e shortcutExpander) Reset() {
|
||||||
|
meta.MaybeResetRESTMapper(e.RESTMapper)
|
||||||
|
}
|
||||||
|
|
||||||
// ResourceShortcuts represents a structure that holds the information how to
|
// ResourceShortcuts represents a structure that holds the information how to
|
||||||
// transition from resource's shortcut to its full name.
|
// transition from resource's shortcut to its full name.
|
||||||
type resourceShortcuts struct {
|
type resourceShortcuts struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user