controllers

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ScheduleKey is a label applied to every snapshot created by
	// snap-scheduler, denoting the schedule that created it
	ScheduleKey = "snapscheduler.backube/schedule"

	// WhenKey is a label applied to every snapshot created by
	// snap-scheduler, denoting the scheduled (not actual) time of the snapshot
	WhenKey = "snapscheduler.backube/when"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiversionSnapshot

type MultiversionSnapshot struct {
	// contains filtered or unexported fields
}

MultiversionSnapshot abstracts the specific version of the VolumeSnapshot object.

func GetMVSnapshot

func GetMVSnapshot(ctx context.Context, client client.Reader, key types.NamespacedName) (*MultiversionSnapshot, error)

GetMVSnapshot retrieves the VolumeSnapshot with the provided key from the API server. We use this function because the standard client.Get cannot be used with an mvs.

func ListMVSnapshot

func ListMVSnapshot(ctx context.Context,
	client client.Reader,
	opts ...client.ListOption) ([]MultiversionSnapshot, error)

ListMVSnapshot takes the place of client.List for MultiversionSnapshot objects.

func WrapSnapshotAlpha

func WrapSnapshotAlpha(snap *snapv1alpha1.VolumeSnapshot) *MultiversionSnapshot

WrapSnapshotAlpha encapsulates a v1alpha1 VolumeSnapshot.

func WrapSnapshotBeta

func WrapSnapshotBeta(snap *snapv1beta1.VolumeSnapshot) *MultiversionSnapshot

WrapSnapshotBeta encapsulates a v1beta1 VolumeSnapshot.

func (*MultiversionSnapshot) Create

func (mvs *MultiversionSnapshot) Create(ctx context.Context, client client.Writer, opts ...client.CreateOption) error

Create saves the snapshot in the Kubernetes cluster.

func (*MultiversionSnapshot) Delete

func (mvs *MultiversionSnapshot) Delete(ctx context.Context, client client.Writer, opts ...client.DeleteOption) error

Delete deletes the snapshot from Kubernetes cluster.

func (*MultiversionSnapshot) ObjectMeta

func (mvs *MultiversionSnapshot) ObjectMeta() *metav1.ObjectMeta

ObjectMeta returns the metadata portion from the underlying VolumeSnapshot.

func (*MultiversionSnapshot) ReadyToUse

func (mvs *MultiversionSnapshot) ReadyToUse() *bool

ReadyToUse returns a boolean indicating whether the snapshot is ready to be used

func (*MultiversionSnapshot) SnapshotClassName

func (mvs *MultiversionSnapshot) SnapshotClassName() *string

SnapshotClassName returns the name of the SnapshotClass for this VolumeSnapshot

func (*MultiversionSnapshot) SourcePvcName

func (mvs *MultiversionSnapshot) SourcePvcName() *string

SourcePvcName returns the name of the PVC used as the source for the VolumeSnapshot.

type SnapshotScheduleReconciler

type SnapshotScheduleReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

SnapshotScheduleReconciler reconciles a SnapshotSchedule object

func (*SnapshotScheduleReconciler) Reconcile

func (r *SnapshotScheduleReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*SnapshotScheduleReconciler) SetupWithManager

func (r *SnapshotScheduleReconciler) SetupWithManager(mgr ctrl.Manager) error

type SnapshotVersionChecker

type SnapshotVersionChecker struct {
	// contains filtered or unexported fields
}

SnapshotVersionChecker keeps track of which VolumeSnapshot versions are valid in the API server.

var VersionChecker SnapshotVersionChecker

VersionChecker is the cache of valid VolumeSnapshot versions.

func (*SnapshotVersionChecker) Refresh

func (svc *SnapshotVersionChecker) Refresh(logger logr.Logger) error

Refresh queries the API server to determine the current valid versions.

func (*SnapshotVersionChecker) SetConfig

func (svc *SnapshotVersionChecker) SetConfig(c *rest.Config) error

SetConfig sets the configuration the version checker should use to communicate w/ the API server.

Jump to

Keyboard shortcuts

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