controller

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Name of finalizer on VolumeSnapshotContents that are bound by VolumeSnapshots
	VolumeSnapshotContentFinalizer = "snapshot.storage.kubernetes.io/volumesnapshotcontent-protection"
	VolumeSnapshotFinalizer        = "snapshot.storage.kubernetes.io/volumesnapshot-protection"
)
View Source
const IsDefaultSnapshotClassAnnotation = "snapshot.storage.kubernetes.io/is-default-class"

Variables

This section is empty.

Functions

func GetSnapshotContentNameForSnapshot

func GetSnapshotContentNameForSnapshot(snapshot *crdv1.VolumeSnapshot) string

GetSnapshotContentNameForSnapshot returns SnapshotContent.Name for the create VolumeSnapshotContent. The name must be unique.

func IsDefaultAnnotation

func IsDefaultAnnotation(obj metav1.ObjectMeta) bool

IsDefaultAnnotation returns a boolean if the annotation is set

func IsSnapshotBound

func IsSnapshotBound(snapshot *crdv1.VolumeSnapshot, content *crdv1.VolumeSnapshotContent) bool

func NewCSISnapshotController

func NewCSISnapshotController(
	clientset clientset.Interface,
	client kubernetes.Interface,
	snapshotterName string,
	volumeSnapshotInformer storageinformers.VolumeSnapshotInformer,
	volumeSnapshotContentInformer storageinformers.VolumeSnapshotContentInformer,
	volumeSnapshotClassInformer storageinformers.VolumeSnapshotClassInformer,
	createSnapshotContentRetryCount int,
	createSnapshotContentInterval time.Duration,
	conn connection.CSIConnection,
	timeout time.Duration,
	resyncPeriod time.Duration,
	snapshotNamePrefix string,
	snapshotNameUUIDLength int,
) *csiSnapshotController

NewCSISnapshotController returns a new *csiSnapshotController

func NoResyncPeriodFunc

func NoResyncPeriodFunc() time.Duration

Returns 0 for resyncPeriod in case resyncing is not needed.

Types

type Handler

type Handler interface {
	CreateSnapshot(snapshot *crdv1.VolumeSnapshot, volume *v1.PersistentVolume, parameters map[string]string, snapshotterCredentials map[string]string) (string, string, int64, int64, bool, error)
	DeleteSnapshot(content *crdv1.VolumeSnapshotContent, snapshotterCredentials map[string]string) error
	GetSnapshotStatus(content *crdv1.VolumeSnapshotContent) (bool, int64, int64, error)
}

Handler is responsible for handling VolumeSnapshot events from informer.

func NewCSIHandler

func NewCSIHandler(
	csiConnection connection.CSIConnection,
	timeout time.Duration,
	snapshotNamePrefix string,
	snapshotNameUUIDLength int,
) Handler

Jump to

Keyboard shortcuts

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