meta

package
v1.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheDynamicRESTMapperKey = "_internal/restmapper/cache-crd-restmapper.conf"
	SepForGVR                 = "/"
)

Variables

View Source
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

type RESTMapperManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

RESTMapperManager is responsible for managing different kind of RESTMapper

func NewRESTMapperManager

func NewRESTMapperManager(baseDir string) (*RESTMapperManager, error)

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL