instancesnapshot_controller

package
v0.0.0-...-2e8aeb9 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package instancesnapshot_controller groups the functionalities related to the creation of a persistent VM snapshot.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainersSnapshotOpts

type ContainersSnapshotOpts struct {
	ContainerKaniko    string
	ContainerImgExport string
	VMRegistry         string
	RegistrySecretName string
}

ContainersSnapshotOpts contains image names and tags of the containers needed for the VM snapshot, along with VM registry access data.

type InstanceSnapshotReconciler

type InstanceSnapshotReconciler struct {
	client.Client
	EventsRecorder     record.EventRecorder
	Scheme             *runtime.Scheme
	NamespaceWhitelist metav1.LabelSelector
	ContainersSnapshot ContainersSnapshotOpts

	// This function, if configured, is deferred at the beginning of the Reconcile.
	// Specifically, it is meant to be set to GinkgoRecover during the tests,
	// in order to lead to a controlled failure in case the Reconcile panics.
	ReconcileDeferHook func()
}

InstanceSnapshotReconciler reconciles a InstanceSnapshot object.

func (*InstanceSnapshotReconciler) CreateSnapshottingJob

func (r *InstanceSnapshotReconciler) CreateSnapshottingJob(ctx context.Context, isnap *crownlabsv1alpha2.InstanceSnapshot) (bool, error)

CreateSnapshottingJob creates the job in charge of creating the snapshot.

func (*InstanceSnapshotReconciler) CreateSnapshottingJobDefinition

func (r *InstanceSnapshotReconciler) CreateSnapshottingJobDefinition(ctx context.Context, isnap *crownlabsv1alpha2.InstanceSnapshot) (batch.Job, error)

CreateSnapshottingJobDefinition generates the job to be created.

func (*InstanceSnapshotReconciler) GetJobStatus

GetJobStatus sets a Job and returns its status.

func (*InstanceSnapshotReconciler) HandleExistingJob

HandleExistingJob checks the status of the existing job and updates the status of the InstanceSnapshot accordingly.

func (*InstanceSnapshotReconciler) Reconcile

Reconcile reconciles the status of the InstanceSnapshot resource.

func (*InstanceSnapshotReconciler) SetupWithManager

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

SetupWithManager registers a new controller for InstanceSnapshot resources.

func (*InstanceSnapshotReconciler) ValidateRequest

ValidateRequest validates the InstanceSnapshot request, returns an error and if there's the need to try again.

Jump to

Keyboard shortcuts

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