controller

package
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFinalizerName added in v0.4.0

func GetFinalizerName(driver string) string

GetFinalizerName returns Attacher name suitable to be used as finalizer

func GetNodeIDFromCSINode added in v1.1.0

func GetNodeIDFromCSINode(driver string, csiNode *storage.CSINode) (string, bool)

GetNodeIDFromCSINode returns nodeID from CSIDriverInfoSpec

func GetNodeIDFromNode added in v0.4.0

func GetNodeIDFromNode(driver string, node *v1.Node) (string, error)

GetNodeIDFromNode returns nodeID string from node annotations.

func GetVolumeAttributes added in v0.4.0

func GetVolumeAttributes(csiSource *v1.CSIPersistentVolumeSource) (map[string]string, error)

GetVolumeAttributes returns a dictionary of volume attributes from CSI PV source

func GetVolumeCapabilities added in v0.4.0

func GetVolumeCapabilities(pvSpec *v1.PersistentVolumeSpec) (*csi.VolumeCapability, error)

GetVolumeCapabilities returns volumecapability from PV spec

func GetVolumeHandle added in v0.4.0

func GetVolumeHandle(csiSource *v1.CSIPersistentVolumeSource) (string, bool, error)

GetVolumeHandle returns VolumeHandle and Readonly flag from CSI PV source

func SanitizeDriverName added in v0.4.0

func SanitizeDriverName(driver string) string

SanitizeDriverName sanitizes provided driver name.

Types

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) *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)
}

Handler is responsible for handling VolumeAttachment events from informer.

func NewCSIHandler

func NewCSIHandler(
	client kubernetes.Interface,
	attacherName string,
	attacher attacher.Attacher,
	pvLister corelisters.PersistentVolumeLister,
	nodeLister corelisters.NodeLister,
	csiNodeLister storagelisters.CSINodeLister,
	vaLister storagelisters.VolumeAttachmentLister,
	timeout *time.Duration,
	supportsPublishReadOnly bool) Handler

NewCSIHandler creates a new CSIHandler.

func NewTrivialHandler

func NewTrivialHandler(client kubernetes.Interface) Handler

NewTrivialHandler provides new Handler for Volumeattachments and PV object handling.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL