instautoctrl

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 instautoctrl contains the controller for Instance Termination and Submission automations.

Package instautoctrl contains the controller for Instance Termination and Submission automations.

Package instautoctrl contains the controller for Instance Termination and Submission automations.

Package instautoctrl contains the controller for Instance Termination and Submission automations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEnvironmentValidity

func CheckEnvironmentValidity(instance *clv1alpha2.Instance, environment *clv1alpha2.Environment) error

CheckEnvironmentValidity checks whether the given environment is valid and returns it (there must be one environment that must be persistent and contestDestination within instance spec customization urls must be present).

func RetrieveEnvironment

func RetrieveEnvironment(ctx context.Context, c client.Client, instance *clv1alpha2.Instance) (*clv1alpha2.Environment, error)

RetrieveEnvironment retrieves the template associated to the given instance.

Types

type InstanceSubmissionReconciler

type InstanceSubmissionReconciler struct {
	client.Client
	EventsRecorder     record.EventRecorder
	Scheme             *runtime.Scheme
	NamespaceWhitelist metav1.LabelSelector
	ContainerEnvOpts   forge.ContainerEnvOpts
	// 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()
}

InstanceSubmissionReconciler watches for instances to be terminated.

func (*InstanceSubmissionReconciler) CheckLabelSelectors

func (r *InstanceSubmissionReconciler) CheckLabelSelectors(ctx context.Context, instance *clv1alpha2.Instance) (bool, error)

CheckLabelSelectors checks whether the given instance is eligible for reconciliation.

func (*InstanceSubmissionReconciler) EnforceInstanceSubmissionJob

func (r *InstanceSubmissionReconciler) EnforceInstanceSubmissionJob(ctx context.Context, instance *clv1alpha2.Instance, environment *clv1alpha2.Environment) (jobStatus *batch.JobStatus, err error)

EnforceInstanceSubmissionJob ensures that the submission job for the given instance is present.

func (*InstanceSubmissionReconciler) Reconcile

Reconcile reconciles the status of the InstanceSnapshot resource.

func (*InstanceSubmissionReconciler) SetupWithManager

func (r *InstanceSubmissionReconciler) SetupWithManager(mgr ctrl.Manager, concurrency int) error

SetupWithManager registers a new controller for InstanceSubmissionReconciler resources.

type InstanceTerminationReconciler

type InstanceTerminationReconciler struct {
	client.Client
	EventsRecorder              record.EventRecorder
	Scheme                      *runtime.Scheme
	NamespaceWhitelist          metav1.LabelSelector
	StatusCheckRequestTimeout   time.Duration
	InstanceStatusCheckInterval time.Duration
	// 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()
}

InstanceTerminationReconciler watches for instances to be terminated.

func (*InstanceTerminationReconciler) CheckInstanceTermination

func (r *InstanceTerminationReconciler) CheckInstanceTermination(ctx context.Context, instance *clv1alpha2.Instance) (bool, error)

CheckInstanceTermination checks if the Instance has to be terminated.

func (*InstanceTerminationReconciler) Reconcile

Reconcile reconciles the status of the InstanceSnapshot resource.

func (*InstanceTerminationReconciler) SetupWithManager

func (r *InstanceTerminationReconciler) SetupWithManager(mgr ctrl.Manager, concurrency int) error

SetupWithManager registers a new controller for InstanceTerminationReconciler resources.

func (*InstanceTerminationReconciler) TerminateInstance

func (r *InstanceTerminationReconciler) TerminateInstance(ctx context.Context, instance *clv1alpha2.Instance) error

TerminateInstance terminates the Instance.

type StatusCheckResponse

type StatusCheckResponse struct {
	Error    string    `json:"error,omitempty"`
	Deadline time.Time `json:"deadline,omitempty"`
	ID       string    `json:"idnumber,omitempty"`
}

StatusCheckResponse is the expected response from the instance status check URL.

Jump to

Keyboard shortcuts

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