Documentation ¶
Index ¶
- func CreateCustomResourceDefinitionFromManifest(ctx context.Context, embedFiles embed.FS, fileName string) error
- func CreateCustomResourceDefinitionFromSpec(ctx context.Context, crdName string, crdSingular string, crdPlural string, ...) error
- func CreateKubernetesClientFromConfig(kubeConfigPath string) (clientset.Interface, error)
- func GetDynamicInformer(ctx context.Context, crdGroup, crdVersion, crdName, namespace string, ...) (informers.GenericInformer, error)
- func GetKubeConfig(ctx context.Context) (*restclient.Config, error)
- func GetNodeIdFromCSINode(csiNode *storagev1.CSINode) string
- func GetNodeUUID(ctx context.Context, k8sclient clientset.Interface, nodeName string, ...) (string, error)
- func GetRestClientConfigForSupervisor(ctx context.Context, endpoint string, port string) *restclient.Config
- func NewCSINodeTopologyWatcher(ctx context.Context, config *restclient.Config) (*cache.ListWatch, error)
- func NewClient(ctx context.Context) (clientset.Interface, error)
- func NewClientForGroup(ctx context.Context, config *restclient.Config, groupName string) (client.Client, error)
- func NewCnsFileAccessConfigWatcher(ctx context.Context, config *restclient.Config, namespace string) (*cache.ListWatch, error)
- func NewSnapshotterClient(ctx context.Context) (snapshotterClientSet.Interface, error)
- func NewSupervisorClient(ctx context.Context, config *restclient.Config) (clientset.Interface, error)
- func NewSupervisorSnapshotClient(ctx context.Context, config *restclient.Config) (snapshotterClientSet.Interface, error)
- func NewVirtualMachineWatcher(ctx context.Context, config *restclient.Config, namespace string) (*cache.ListWatch, error)
- type InformerManager
- func (im *InformerManager) AddCSINodeListener(add func(obj interface{}), update func(oldObj, newObj interface{}), ...)
- func (im *InformerManager) AddConfigMapListener(ctx context.Context, client clientset.Interface, namespace string, ...)
- func (im *InformerManager) AddNamespaceListener(add func(obj interface{}), update func(oldObj, newObj interface{}), ...)
- func (im *InformerManager) AddNodeListener(add func(obj interface{}), update func(oldObj, newObj interface{}), ...)
- func (im *InformerManager) AddPVCListener(add func(obj interface{}), update func(oldObj, newObj interface{}), ...)
- func (im *InformerManager) AddPVListener(add func(obj interface{}), update func(oldObj, newObj interface{}), ...)
- func (im *InformerManager) AddPodListener(add func(obj interface{}), update func(oldObj, newObj interface{}), ...)
- func (im *InformerManager) AddVolumeAttachmentListener(add func(obj interface{}), update func(oldObj, newObj interface{}), ...)
- func (im *InformerManager) GetConfigMapLister() corelisters.ConfigMapLister
- func (im *InformerManager) GetPVCLister() corelisters.PersistentVolumeClaimLister
- func (im *InformerManager) GetPVLister() corelisters.PersistentVolumeLister
- func (im *InformerManager) GetPodLister() corelisters.PodLister
- func (im *InformerManager) Listen() (stopCh <-chan struct{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCustomResourceDefinitionFromManifest ¶
func CreateCustomResourceDefinitionFromManifest(ctx context.Context, embedFiles embed.FS, fileName string) error
CreateCustomResourceDefinitionFromManifest creates custom resource definition spec from manifest file.
func CreateCustomResourceDefinitionFromSpec ¶
func CreateCustomResourceDefinitionFromSpec(ctx context.Context, crdName string, crdSingular string, crdPlural string, crdKind string, crdGroup string, crdVersion string, crdScope apiextensionsv1.ResourceScope) error
CreateCustomResourceDefinitionFromSpec creates the custom resource definition from given spec. If there is error, function will do the clean up.
func CreateKubernetesClientFromConfig ¶
CreateKubernetesClientFromConfig creaates a newk8s client from given kubeConfig file.
func GetDynamicInformer ¶
func GetDynamicInformer(ctx context.Context, crdGroup, crdVersion, crdName, namespace string, cfg *restclient.Config, isInCluster bool) (informers.GenericInformer, error)
GetDynamicInformer returns informer for specified CRD group, version, name and namespace.
isInCluster should be set to true if the resource is present in the same cluster, otherwise set false if the resource is present in the supervisor cluster in TKG flavor.
Takes an input configuration to create a client for the dynamic informer. If isInCluster is set to true, the config contains credentials to the in cluster API server. If isInCluster is set to false, config contains credentials to the supervisor cluster.
func GetKubeConfig ¶
func GetKubeConfig(ctx context.Context) (*restclient.Config, error)
GetKubeConfig helps retrieve Kubernetes Config.
func GetNodeIdFromCSINode ¶ added in v2.5.0
GetNodeIdFromCSINode gets the UUID from CSINode object
func GetNodeUUID ¶ added in v2.5.0
func GetNodeUUID(ctx context.Context, k8sclient clientset.Interface, nodeName string, useK8sCSINodeObj bool) (string, error)
GetNodeUUID returns node UUID set by CCM on the Kubernetes Node API object if is set to true. If not set, returns node UUID from K8s CSINode API object.
func GetRestClientConfigForSupervisor ¶
func GetRestClientConfigForSupervisor(ctx context.Context, endpoint string, port string) *restclient.Config
GetRestClientConfigForSupervisor returns restclient config for given endpoint, port, certificate and token.
func NewCSINodeTopologyWatcher ¶
func NewCSINodeTopologyWatcher(ctx context.Context, config *restclient.Config) (*cache.ListWatch, error)
NewCSINodeTopologyWatcher creates a new ListWatch for CSINodeTopology objects given rest client config.
func NewClientForGroup ¶
func NewClientForGroup(ctx context.Context, config *restclient.Config, groupName string) (client.Client, error)
NewClientForGroup creates a new controller-runtime client for a new scheme. The input Group is added to this scheme.
func NewCnsFileAccessConfigWatcher ¶
func NewCnsFileAccessConfigWatcher(ctx context.Context, config *restclient.Config, namespace string) (*cache.ListWatch, error)
NewCnsFileAccessConfigWatcher creates a new ListWatch for VirtualMachines given rest client config.
func NewSnapshotterClient ¶
func NewSnapshotterClient(ctx context.Context) (snapshotterClientSet.Interface, error)
NewSnapshotterClient creates a new external-snapshotter client based on a service account.
func NewSupervisorClient ¶
func NewSupervisorClient(ctx context.Context, config *restclient.Config) (clientset.Interface, error)
NewSupervisorClient creates a new supervisor client for given restClient config.
func NewSupervisorSnapshotClient ¶ added in v2.7.0
func NewSupervisorSnapshotClient(ctx context.Context, config *restclient.Config) ( snapshotterClientSet.Interface, error)
NewSupervisorSnapshotClient creates a new supervisor client for handling snapshot related objects
func NewVirtualMachineWatcher ¶
func NewVirtualMachineWatcher(ctx context.Context, config *restclient.Config, namespace string) (*cache.ListWatch, error)
NewVirtualMachineWatcher creates a new ListWatch for VirtualMachines given rest client config.
Types ¶
type InformerManager ¶
type InformerManager struct {
// contains filtered or unexported fields
}
InformerManager is a service that notifies subscribers about changes to well-defined information in the Kubernetes API server.
func NewInformer ¶
func NewInformer(client clientset.Interface) *InformerManager
NewInformer creates a new K8S client based on a service account.
func (*InformerManager) AddCSINodeListener ¶ added in v2.5.0
func (im *InformerManager) AddCSINodeListener( add func(obj interface{}), update func(oldObj, newObj interface{}), remove func(obj interface{}))
AddCSINodeNodeListener hooks up add, update, delete callbacks.
func (*InformerManager) AddConfigMapListener ¶
func (im *InformerManager) AddConfigMapListener( ctx context.Context, client clientset.Interface, namespace string, add func(obj interface{}), update func(oldObj, newObj interface{}), remove func(obj interface{}))
AddConfigMapListener hooks up add, update, delete callbacks.
func (*InformerManager) AddNamespaceListener ¶
func (im *InformerManager) AddNamespaceListener( add func(obj interface{}), update func(oldObj, newObj interface{}), remove func(obj interface{}))
AddNamespaceListener hooks up add, update, delete callbacks.
func (*InformerManager) AddNodeListener ¶
func (im *InformerManager) AddNodeListener( add func(obj interface{}), update func(oldObj, newObj interface{}), remove func(obj interface{}))
AddNodeListener hooks up add, update, delete callbacks.
func (*InformerManager) AddPVCListener ¶
func (im *InformerManager) AddPVCListener( add func(obj interface{}), update func(oldObj, newObj interface{}), remove func(obj interface{}))
AddPVCListener hooks up add, update, delete callbacks.
func (*InformerManager) AddPVListener ¶
func (im *InformerManager) AddPVListener( add func(obj interface{}), update func(oldObj, newObj interface{}), remove func(obj interface{}))
AddPVListener hooks up add, update, delete callbacks.
func (*InformerManager) AddPodListener ¶
func (im *InformerManager) AddPodListener( add func(obj interface{}), update func(oldObj, newObj interface{}), remove func(obj interface{}))
AddPodListener hooks up add, update, delete callbacks.
func (*InformerManager) AddVolumeAttachmentListener ¶ added in v2.6.0
func (im *InformerManager) AddVolumeAttachmentListener( add func(obj interface{}), update func(oldObj, newObj interface{}), remove func(obj interface{}))
AddVolumeAttachmentListener hooks up add, update, delete callbacks.
func (*InformerManager) GetConfigMapLister ¶
func (im *InformerManager) GetConfigMapLister() corelisters.ConfigMapLister
GetConfigMapLister returns ConfigMap Lister for the calling informer manager.
func (*InformerManager) GetPVCLister ¶
func (im *InformerManager) GetPVCLister() corelisters.PersistentVolumeClaimLister
GetPVCLister returns PVC Lister for the calling informer manager.
func (*InformerManager) GetPVLister ¶
func (im *InformerManager) GetPVLister() corelisters.PersistentVolumeLister
GetPVLister returns PV Lister for the calling informer manager.
func (*InformerManager) GetPodLister ¶
func (im *InformerManager) GetPodLister() corelisters.PodLister
GetPodLister returns Pod Lister for the calling informer manager.
func (*InformerManager) Listen ¶
func (im *InformerManager) Listen() (stopCh <-chan struct{})
Listen starts the Informers.