Documentation ¶
Overview ¶
Package instancesnapshot_controller groups the functionalities related to the creation of a persistent VM snapshot.
Index ¶
- type ContainersSnapshotOpts
- type InstanceSnapshotReconciler
- func (r *InstanceSnapshotReconciler) CreateSnapshottingJob(ctx context.Context, isnap *crownlabsv1alpha2.InstanceSnapshot) (bool, error)
- func (r *InstanceSnapshotReconciler) CreateSnapshottingJobDefinition(ctx context.Context, isnap *crownlabsv1alpha2.InstanceSnapshot) (batch.Job, error)
- func (r *InstanceSnapshotReconciler) GetJobStatus(job *batch.Job) (bool, batch.JobConditionType)
- func (r *InstanceSnapshotReconciler) HandleExistingJob(ctx context.Context, isnap *crownlabsv1alpha2.InstanceSnapshot, ...) (batch.JobConditionType, error)
- func (r *InstanceSnapshotReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *InstanceSnapshotReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *InstanceSnapshotReconciler) ValidateRequest(ctx context.Context, isnap *crownlabsv1alpha2.InstanceSnapshot) (bool, error)
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 ¶
func (r *InstanceSnapshotReconciler) GetJobStatus(job *batch.Job) (bool, batch.JobConditionType)
GetJobStatus sets a Job and returns its status.
func (*InstanceSnapshotReconciler) HandleExistingJob ¶
func (r *InstanceSnapshotReconciler) HandleExistingJob(ctx context.Context, isnap *crownlabsv1alpha2.InstanceSnapshot, snapjob *batch.Job) (batch.JobConditionType, error)
HandleExistingJob checks the status of the existing job and updates the status of the InstanceSnapshot accordingly.
func (*InstanceSnapshotReconciler) Reconcile ¶
func (r *InstanceSnapshotReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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 ¶
func (r *InstanceSnapshotReconciler) ValidateRequest(ctx context.Context, isnap *crownlabsv1alpha2.InstanceSnapshot) (bool, error)
ValidateRequest validates the InstanceSnapshot request, returns an error and if there's the need to try again.