Documentation ¶
Index ¶
- Variables
- func AddSearcherByKubeconfig(kubeconfigBytes []byte, namespace string) error
- func ConvertGvkToApiResource(gvk *schema.GroupVersionKind, grs []*restmapper.APIGroupResources) (*metav1.APIResource, error)
- func ConvertRuntimeObjectToCRD(obj runtime.Object) (*apiextensions.CustomResourceDefinition, error)
- func GetAllAppNameByNamespace(kubeconfigBytes []byte, ns string) sets.String
- func GetApiGroupResources(kubeBytes []byte, ns string) ([]*restmapper.APIGroupResources, error)
- func RemoveSearcherByKubeconfig(kubeconfigBytes []byte, namespace string) error
- type GvkGvrWithAlias
- type ResourceEventHandlerFuncs
- type Searcher
Constants ¶
This section is empty.
Variables ¶
View Source
var GroupToTypeMap = []struct { K string V []string }{ { K: "Workloads", V: []string{ "Deployment.v1.apps", "StatefulSet.v1.apps", "DaemonSet.v1.apps", "Job.v1.batch", "CronJob.v1beta1.batch", "CronJob.v1.batch", "Pod.v1.", }, }, { K: "Networks", V: []string{ "Service.v1.", "Endpoints.v1.", "Ingress.v1.networking.k8s.io", "NetworkPolicy.v1.networking.k8s.io", }, }, { K: "Configurations", V: []string{ "ConfigMap.v1.", "Secret.v1.", "HorizontalPodAutoscaler.v1.autoscaling", "ResourceQuota.v1.", "PodDisruptionBudget.v1.policy", }, }, { K: "Storages", V: []string{ "PersistentVolume.v1.", "PersistentVolumeClaim.v1.", "StorageClass.v1.storage.k8s.io", }, }, }
GroupToTypeMap K: Workloads/Networks/Configurations V: deployments/statefulset
Functions ¶
func AddSearcherByKubeconfig ¶
AddSearcherByKubeconfig init informer in advance
func ConvertGvkToApiResource ¶
func ConvertGvkToApiResource(gvk *schema.GroupVersionKind, grs []*restmapper.APIGroupResources) (*metav1.APIResource, error)
func ConvertRuntimeObjectToCRD ¶
func ConvertRuntimeObjectToCRD(obj runtime.Object) (*apiextensions.CustomResourceDefinition, error)
func GetApiGroupResources ¶
func GetApiGroupResources(kubeBytes []byte, ns string) ([]*restmapper.APIGroupResources, error)
func RemoveSearcherByKubeconfig ¶
RemoveSearcherByKubeconfig remove informer from cache
Types ¶
type GvkGvrWithAlias ¶
type GvkGvrWithAlias struct { Gvr schema.GroupVersionResource Gvk schema.GroupVersionKind // namespaced indicates if a resource is namespaced or not. Namespaced bool // contains filtered or unexported fields }
func ConvertCRDToGgwa ¶
func ConvertCRDToGgwa(crdObj *apiextensions.CustomResourceDefinition, agrs []*restmapper.APIGroupResources) []GvkGvrWithAlias
func (*GvkGvrWithAlias) GetFullName ¶
func (g *GvkGvrWithAlias) GetFullName() string
type ResourceEventHandlerFuncs ¶
type ResourceEventHandlerFuncs struct { cache.ResourceEventHandler Gvr schema.GroupVersionResource // contains filtered or unexported fields }
func NewResourceEventHandlerFuncs ¶
func NewResourceEventHandlerFuncs(resource informers.GenericInformer, kubeconfigBytes []byte, gvr schema.GroupVersionResource) *ResourceEventHandlerFuncs
func (*ResourceEventHandlerFuncs) OnAdd ¶
func (r *ResourceEventHandlerFuncs) OnAdd(interface{})
func (*ResourceEventHandlerFuncs) OnDelete ¶
func (r *ResourceEventHandlerFuncs) OnDelete(obj interface{})
func (*ResourceEventHandlerFuncs) OnUpdate ¶
func (r *ResourceEventHandlerFuncs) OnUpdate(_, _ interface{})
type Searcher ¶
type Searcher struct { SupportSchemaList []GvkGvrWithAlias // contains filtered or unexported fields }
func GetSearcherWithLRU ¶
GetSearcherWithLRU GetSearchWithLRU will cache kubeconfig with LRU
func (*Searcher) GetKubeconfigBytes ¶
func (*Searcher) GetResourceInfo ¶
func (s *Searcher) GetResourceInfo(resourceType string) (GvkGvrWithAlias, error)
func (*Searcher) GetSupportSchema ¶
Click to show internal directories.
Click to hide internal directories.