Documentation
¶
Index ¶
- func GetFinalizerName(driver string) string
- func GetNodeIDFromCSINode(driver string, csiNode *storage.CSINode) (string, bool)
- func GetVolumeAttributes(csiSource *v1.CSIPersistentVolumeSource) (map[string]string, error)
- func GetVolumeCapabilities(pvSpec *v1.PersistentVolumeSpec) (*csi.VolumeCapability, error)
- func GetVolumeHandle(csiSource *v1.CSIPersistentVolumeSource) (string, bool, error)
- func SanitizeDriverName(driver string) string
- type AttacherCSITranslator
- type CSIAttachController
- type Handler
- type VolumeLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFinalizerName ¶
GetFinalizerName returns Attacher name suitable to be used as finalizer
func GetNodeIDFromCSINode ¶
GetNodeIDFromCSINode returns nodeID from CSIDriverInfoSpec
func GetVolumeAttributes ¶
func GetVolumeAttributes(csiSource *v1.CSIPersistentVolumeSource) (map[string]string, error)
GetVolumeAttributes returns a dictionary of volume attributes from CSI PV source
func GetVolumeCapabilities ¶
func GetVolumeCapabilities(pvSpec *v1.PersistentVolumeSpec) (*csi.VolumeCapability, error)
GetVolumeCapabilities returns volumecapability from PV spec
func GetVolumeHandle ¶
func GetVolumeHandle(csiSource *v1.CSIPersistentVolumeSource) (string, bool, error)
GetVolumeHandle returns VolumeHandle and Readonly flag from CSI PV source
func SanitizeDriverName ¶
SanitizeDriverName sanitizes provided driver name.
Types ¶
type AttacherCSITranslator ¶
type AttacherCSITranslator interface {
TranslateInTreePVToCSI(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)
IsPVMigratable(pv *v1.PersistentVolume) bool
RepairVolumeHandle(pluginName, volumeHandle, nodeID string) (string, error)
}
type CSIAttachController ¶
type CSIAttachController struct {
// contains filtered or unexported fields
}
CSIAttachController is a controller that attaches / detaches CSI volumes using provided Handler interface
func NewCSIAttachController ¶
func NewCSIAttachController(client kubernetes.Interface, attacherName string, handler Handler, volumeAttachmentInformer storageinformers.VolumeAttachmentInformer, pvInformer coreinformers.PersistentVolumeInformer, vaRateLimiter, paRateLimiter workqueue.RateLimiter, shouldReconcileVolumeAttachment bool, reconcileSync time.Duration) *CSIAttachController
NewCSIAttachController returns a new *CSIAttachController
func (*CSIAttachController) Run ¶
func (ctrl *CSIAttachController) Run(workers int, stopCh <-chan struct{})
Run starts CSI attacher and listens on channel events
type Handler ¶
type Handler interface {
Init(vaQueue workqueue.RateLimitingInterface, pvQueue workqueue.RateLimitingInterface)
// SyncNewOrUpdatedVolumeAttachment processes one Add/Updated event from
// VolumeAttachment informers. It runs in a workqueue, guaranting that only
// one SyncNewOrUpdatedVolumeAttachment runs for given VA.
// SyncNewOrUpdatedVolumeAttachment is responsible for marking the
// VolumeAttachment either as forgotten (resets exponential backoff) or
// re-queue it into the vaQueue to process it after exponential
// backoff.
SyncNewOrUpdatedVolumeAttachment(va *storage.VolumeAttachment)
SyncNewOrUpdatedPersistentVolume(pv *v1.PersistentVolume)
ReconcileVA() error
}
Handler is responsible for handling VolumeAttachment events from informer.
func NewCSIHandler ¶
func NewCSIHandler( client kubernetes.Interface, attacherName string, attacher attacher.Attacher, CSIVolumeLister VolumeLister, pvLister corelisters.PersistentVolumeLister, csiNodeLister storagelisters.CSINodeLister, vaLister storagelisters.VolumeAttachmentLister, timeout *time.Duration, supportsPublishReadOnly bool, translator AttacherCSITranslator) Handler
NewCSIHandler creates a new CSIHandler.
func NewTrivialHandler ¶
func NewTrivialHandler(client kubernetes.Interface) Handler
NewTrivialHandler provides new Handler for Volumeattachments and PV object handling.
type VolumeLister ¶
type VolumeLister interface {
// ListVolumes calls ListVolumes on the driver and returns a map with keys
// of VolumeID and values of the list of Node IDs that volume is published
// on
ListVolumes(ctx context.Context) (map[string][]string, error)
}
Lister implements list operations against a remote CSI driver.