mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-31 14:54:27 +00:00
Merge pull request #105623 from ash2k/ash2k/resettable-rest-mapper
ResettableRESTMapper to make it possible to reset wrapped mappers Kubernetes-commit: 165b581759794157b4f4b8d7dfe2501d0e965ff4
This commit is contained in:
commit
3f38fd30fc
4
go.mod
4
go.mod
@ -31,7 +31,7 @@ require (
|
||||
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
|
||||
google.golang.org/protobuf v1.27.1
|
||||
k8s.io/api v0.0.0-20211117032144-b7adf12040d3
|
||||
k8s.io/apimachinery v0.0.0-20211117031931-f3cf56ed60da
|
||||
k8s.io/apimachinery v0.0.0-20211117031932-cc08b72c0267
|
||||
k8s.io/klog/v2 v2.30.0
|
||||
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65
|
||||
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b
|
||||
@ -41,5 +41,5 @@ require (
|
||||
|
||||
replace (
|
||||
k8s.io/api => k8s.io/api v0.0.0-20211117032144-b7adf12040d3
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20211117031931-f3cf56ed60da
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20211117031932-cc08b72c0267
|
||||
)
|
||||
|
4
go.sum
4
go.sum
@ -612,8 +612,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
k8s.io/api v0.0.0-20211117032144-b7adf12040d3 h1:OUKo3mc2wSOr2GGk0MiMWhZOca1INVHD0Ol0zHOmlKU=
|
||||
k8s.io/api v0.0.0-20211117032144-b7adf12040d3/go.mod h1:B1McGV/Uyv/c0sGZKsHMP4FArbyZZ8Emx+a7h5d/tMs=
|
||||
k8s.io/apimachinery v0.0.0-20211117031931-f3cf56ed60da h1:7W2cMPNnhm4snbd4zGcOBzi233V4+x1jHHeDq2Fr/nE=
|
||||
k8s.io/apimachinery v0.0.0-20211117031931-f3cf56ed60da/go.mod h1:SqloDTPqePPNhEp8K4qUgqpKc3tE+ymn05iIUbSAQ7g=
|
||||
k8s.io/apimachinery v0.0.0-20211117031932-cc08b72c0267 h1:vbR4nyGR/pk2oRTy+vNbzFR5cJQz5vg5NceVPvJuzso=
|
||||
k8s.io/apimachinery v0.0.0-20211117031932-cc08b72c0267/go.mod h1:SqloDTPqePPNhEp8K4qUgqpKc3tE+ymn05iIUbSAQ7g=
|
||||
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
|
||||
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
|
||||
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
|
||||
|
@ -335,4 +335,4 @@ func (d *DeferredDiscoveryRESTMapper) String() string {
|
||||
}
|
||||
|
||||
// Make sure it satisfies the interface
|
||||
var _ meta.RESTMapper = &DeferredDiscoveryRESTMapper{}
|
||||
var _ meta.ResettableRESTMapper = &DeferredDiscoveryRESTMapper{}
|
||||
|
@ -34,7 +34,7 @@ type shortcutExpander struct {
|
||||
discoveryClient discovery.DiscoveryInterface
|
||||
}
|
||||
|
||||
var _ meta.RESTMapper = &shortcutExpander{}
|
||||
var _ meta.ResettableRESTMapper = shortcutExpander{}
|
||||
|
||||
// NewShortcutExpander wraps a restmapper in a layer that expands shortcuts found via discovery
|
||||
func NewShortcutExpander(delegate meta.RESTMapper, client discovery.DiscoveryInterface) meta.RESTMapper {
|
||||
@ -164,6 +164,10 @@ func (e shortcutExpander) expandResourceShortcut(resource schema.GroupVersionRes
|
||||
return resource
|
||||
}
|
||||
|
||||
func (e shortcutExpander) Reset() {
|
||||
meta.MaybeResetRESTMapper(e.RESTMapper)
|
||||
}
|
||||
|
||||
// ResourceShortcuts represents a structure that holds the information how to
|
||||
// transition from resource's shortcut to its full name.
|
||||
type resourceShortcuts struct {
|
||||
|
Loading…
Reference in New Issue
Block a user