Documentation ¶
Index ¶
- Variables
- func AddNVMeLabels(ctx context.Context, kubeConfigPath string, kubeNodeName string, ...) error
- func CreateKubeClientSet(kubeconfig string) (*kubernetes.Clientset, error)
- func GetNVMeUUIDs(ctx context.Context, kubeConfigPath string) (map[string]string, error)
- func GetNodeLabels(ctx context.Context, kubeConfigPath string, kubeNodeName string) (map[string]string, error)
- type NodeLabelsModifierImpl
- type NodeLabelsModifierInterface
- type NodeLabelsRetrieverImpl
- func (svc *NodeLabelsRetrieverImpl) BuildConfigFromFlags(masterURL, kubeconfig string) (*rest.Config, error)
- func (svc *NodeLabelsRetrieverImpl) GetNVMeUUIDs(ctx context.Context, k8sclientset *kubernetes.Clientset) (map[string]string, error)
- func (svc *NodeLabelsRetrieverImpl) GetNodeLabels(ctx context.Context, k8sclientset *kubernetes.Clientset, kubeNodeName string) (map[string]string, error)
- func (svc *NodeLabelsRetrieverImpl) InClusterConfig() (*rest.Config, error)
- func (svc *NodeLabelsRetrieverImpl) NewForConfig(config *rest.Config) (*kubernetes.Clientset, error)
- type NodeLabelsRetrieverInterface
Constants ¶
This section is empty.
Variables ¶
var ( NodeLabelsRetriever NodeLabelsRetrieverInterface NodeLabelsModifier NodeLabelsModifierInterface )
NodeLabelsRetriever is the actual instance of NodeLabelsRetrieverInterface which is used to retrieve the node labels
Functions ¶
func AddNVMeLabels ¶ added in v2.12.0
func AddNVMeLabels(ctx context.Context, kubeConfigPath string, kubeNodeName string, labelKey string, labelValue []string) error
AddNVMeLabels adds a hostnqn uuid label in the k8s node
func CreateKubeClientSet ¶
func CreateKubeClientSet(kubeconfig string) (*kubernetes.Clientset, error)
CreateKubeClientSet creates and returns kubeclient set
func GetNVMeUUIDs ¶ added in v2.12.0
GetNVMeUUIDs checks for duplicate hostnqn uuid labels in the k8s node
Types ¶
type NodeLabelsModifierImpl ¶ added in v2.12.0
type NodeLabelsModifierImpl struct{}
NodeLabelsModifierImpl provides the implementation for NodeLabelsModifierInterface
func (*NodeLabelsModifierImpl) AddNVMeLabels ¶ added in v2.12.0
func (svc *NodeLabelsModifierImpl) AddNVMeLabels(ctx context.Context, k8sclientset *kubernetes.Clientset, kubeNodeName string, labelKey string, labelValue []string) error
AddNVMeLabels adds a hostnqn uuid label to the specified Kubernetes node
type NodeLabelsModifierInterface ¶ added in v2.12.0
type NodeLabelsModifierInterface interface {
AddNVMeLabels(ctx context.Context, k8sclientset *kubernetes.Clientset, kubeNodeName string, labelKey string, labelValue []string) error
}
NodeLabelsModifierInterface defines the methods for retrieving Kubernetes Node Labels
type NodeLabelsRetrieverImpl ¶
type NodeLabelsRetrieverImpl struct{}
NodeLabelsRetrieverImpl provided the implementation for NodeLabelsRetrieverInterface
func (*NodeLabelsRetrieverImpl) BuildConfigFromFlags ¶
func (svc *NodeLabelsRetrieverImpl) BuildConfigFromFlags(masterURL, kubeconfig string) (*rest.Config, error)
BuildConfigFromFlags is a method for building kubernetes client config
func (*NodeLabelsRetrieverImpl) GetNVMeUUIDs ¶ added in v2.12.0
func (svc *NodeLabelsRetrieverImpl) GetNVMeUUIDs(ctx context.Context, k8sclientset *kubernetes.Clientset) (map[string]string, error)
GetNVMeUUIDs returns map of hosts with their hostnqn uuids
func (*NodeLabelsRetrieverImpl) GetNodeLabels ¶
func (svc *NodeLabelsRetrieverImpl) GetNodeLabels(ctx context.Context, k8sclientset *kubernetes.Clientset, kubeNodeName string) (map[string]string, error)
GetNodeLabels retrieves the kubernetes node object and returns its labels
func (*NodeLabelsRetrieverImpl) InClusterConfig ¶
func (svc *NodeLabelsRetrieverImpl) InClusterConfig() (*rest.Config, error)
InClusterConfig returns a config object which uses the service account kubernetes gives to pods
func (*NodeLabelsRetrieverImpl) NewForConfig ¶
func (svc *NodeLabelsRetrieverImpl) NewForConfig(config *rest.Config) (*kubernetes.Clientset, error)
NewForConfig creates a new Clientset for the given config
type NodeLabelsRetrieverInterface ¶
type NodeLabelsRetrieverInterface interface { BuildConfigFromFlags(masterURL, kubeconfig string) (*rest.Config, error) InClusterConfig() (*rest.Config, error) NewForConfig(config *rest.Config) (*kubernetes.Clientset, error) GetNodeLabels(ctx context.Context, k8sclientset *kubernetes.Clientset, kubeNodeName string) (map[string]string, error) GetNVMeUUIDs(ctx context.Context, k8sclientset *kubernetes.Clientset) (map[string]string, error) }
NodeLabelsRetrieverInterface defines the methods for retrieving Kubernetes Node Labels