Documentation ¶
Index ¶
Constants ¶
const ( // ProtocolNfs Protocol NFS in lower case ProtocolNfs = "nfs" // CsiDriverNamePowerScale CSI PowerScale Name CsiDriverNamePowerScale = "isilon" // CsiDriverNamePowerMax CSI PowerMax Name CsiDriverNamePowerMax = "powermax" )
Variables ¶
var ConnectFn = func(api *API) error { config, err := getConfig() if err != nil { return err } api.Client, err = NewConfigFn(config) if err != nil { return err } return nil }
ConnectFn will connect the client to the k8s API
var InClusterConfigFn = func() (*rest.Config, error) { return rest.InClusterConfig() }
InClusterConfigFn will return a valid configuration if we are running in a Pod on a kubernetes cluster
var NewConfigFn = func(config *rest.Config) (*kubernetes.Clientset, error) { return kubernetes.NewForConfig(config) }
NewConfigFn will return a valid kubernetes.Clientset
Functions ¶
Types ¶
type API ¶
type API struct { Client kubernetes.Interface Lock sync.Mutex }
API holds data used to access the K8S API
func (*API) GetPersistentVolumes ¶
func (api *API) GetPersistentVolumes() (*corev1.PersistentVolumeList, error)
GetPersistentVolumes will return a list of persistent volumes in the kubernetes cluster
type VolumeFinder ¶
type VolumeFinder struct { API VolumeGetter DriverNames []string Logger *logrus.Logger }
VolumeFinder is a volume finder that will query the Kubernetes API for Persistent Volumes created by a matching DriverName
func (VolumeFinder) GetPersistentVolumes ¶
func (f VolumeFinder) GetPersistentVolumes(ctx context.Context) ([]VolumeInfo, error)
GetPersistentVolumes will return a list of persistent volume information
type VolumeGetter ¶
type VolumeGetter interface {
GetPersistentVolumes() (*corev1.PersistentVolumeList, error)
}
VolumeGetter is an interface for getting a list of persistent volume information
type VolumeInfo ¶
type VolumeInfo struct { Namespace string `json:"namespace"` PersistentVolumeClaim string `json:"persistent_volume_claim"` PersistentVolumeStatus string `json:"volume_status"` VolumeClaimName string `json:"volume_claim_name"` PersistentVolume string `json:"persistent_volume"` StorageClass string `json:"storage_class"` Driver string `json:"driver"` ProvisionedSize string `json:"provisioned_size"` StorageSystemVolumeName string `json:"storage_system_volume_name"` StoragePoolName string `json:"storage_pool_name"` StorageSystem string `json:"storage_system"` Protocol string `json:"protocol"` CreatedTime string `json:"created_time"` }
VolumeInfo contains information about mapping a Persistent Volume to the volume created on a storage system