Documentation ¶
Index ¶
- Constants
- Variables
- func IsSchemeResource(gvr schema.GroupVersionResource) bool
- func NewDefaultRESTMapperFromScheme() *meta.DefaultRESTMapper
- type RESTMapperManager
- func (rm *RESTMapperManager) DeleteKindFor(gvr schema.GroupVersionResource) error
- func (rm *RESTMapperManager) KindFor(gvr schema.GroupVersionResource) (bool, schema.GroupVersionKind)
- func (rm *RESTMapperManager) ResetRESTMapper() error
- func (rm *RESTMapperManager) UpdateKind(gvk schema.GroupVersionKind) error
Constants ¶
const ( CacheDynamicRESTMapperKey = "_internal/restmapper/cache-crd-restmapper.conf" SepForGVR = "/" )
Variables ¶
var (
ErrGVRNotRecognized = errors.New("GroupVersionResource is not recognized")
)
Functions ¶
func IsSchemeResource ¶
func IsSchemeResource(gvr schema.GroupVersionResource) bool
IsSchemeResource is used to determine whether gvr is a built-in resource
func NewDefaultRESTMapperFromScheme ¶
func NewDefaultRESTMapperFromScheme() *meta.DefaultRESTMapper
Types ¶
type RESTMapperManager ¶
RESTMapperManager is responsible for managing different kind of RESTMapper
func NewRESTMapperManager ¶
func NewRESTMapperManager(storage storage.Store) *RESTMapperManager
func (*RESTMapperManager) DeleteKindFor ¶
func (rm *RESTMapperManager) DeleteKindFor(gvr schema.GroupVersionResource) error
DeleteKindFor is used to delete the GVK information related to the incoming gvr
func (*RESTMapperManager) KindFor ¶
func (rm *RESTMapperManager) KindFor(gvr schema.GroupVersionResource) (bool, schema.GroupVersionKind)
KindFor is used to find GVK based on GVR information. 1. return true means the GVR is a built-in resource in scheme. 2.1 return false and non-empty GVK means the GVR is custom resource 2.2 return false and empty GVK means the GVR is unknown resource.
func (*RESTMapperManager) ResetRESTMapper ¶
func (rm *RESTMapperManager) ResetRESTMapper() error
ResetRESTMapper is used to clean up all cached GVR/GVK information in DynamicRESTMapper, and delete the corresponding file in the disk (cache-crd-restmapper.conf), it should be used carefully.
func (*RESTMapperManager) UpdateKind ¶
func (rm *RESTMapperManager) UpdateKind(gvk schema.GroupVersionKind) error
UpdateKind is used to verify and add the GVK and GVR mapping relationships of new Custom Resource