action

package
v0.7.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	// Execute executes the action.
	Execute(ctx Context) (*dpv1alpha1.ActionStatus, error)

	// GetName returns the Name of the action.
	GetName() string

	// Type returns the type of the action.
	Type() dpv1alpha1.ActionType
}

type Context

type Context struct {
	Ctx      context.Context
	Client   client.Client
	Recorder record.EventRecorder

	Scheme           *runtime.Scheme
	RestClientConfig *rest.Config
}

type CreateVolumeSnapshotAction

type CreateVolumeSnapshotAction struct {
	// Name is the Name of the action.
	Name string

	// Owner is the owner of the volume snapshot.
	Owner client.Object

	// ObjectMeta is the metadata of the volume snapshot.
	ObjectMeta metav1.ObjectMeta

	// PersistentVolumeClaimWrappers is the list of persistent volume claims wrapper to snapshot.
	PersistentVolumeClaimWrappers []PersistentVolumeClaimWrapper
}

CreateVolumeSnapshotAction is an action that creates the volume snapshot.

func (*CreateVolumeSnapshotAction) Execute

func (*CreateVolumeSnapshotAction) GetName

func (c *CreateVolumeSnapshotAction) GetName() string

func (*CreateVolumeSnapshotAction) Type

type ErrorMode

type ErrorMode string
const (
	ErrorModeContinue ErrorMode = "Continue"
	ErrorModeFail     ErrorMode = "Fail"
)

type ExecAction

type ExecAction struct {
	JobAction

	// PodName is the Name of the pod to execute the command on.
	PodName string

	// Namespace is the Namespace of the pod to execute the command on.
	Namespace string

	// Command is the command to execute.
	Command []string

	// Container is the container to execute the command on.
	Container string

	// ServiceAccountName is the service account to use to build the job object.
	ServiceAccountName string

	// Timeout is the timeout for the command.
	Timeout metav1.Duration
}

ExecAction is an action that executes a command on a pod. This action will create a job to execute the command.

func (*ExecAction) Execute

func (e *ExecAction) Execute(ctx Context) (*dpv1alpha1.ActionStatus, error)

type JobAction

type JobAction struct {
	// Name is the Name of the action.
	Name string

	// Owner is the owner of the job.
	Owner client.Object

	// ObjectMeta is the metadata of the job.
	ObjectMeta metav1.ObjectMeta

	// PodSpec is the
	PodSpec *corev1.PodSpec

	// BackOffLimit is the number of retries before considering a JobAction as failed.
	BackOffLimit *int32
}

JobAction is an action that creates a batch job.

func (*JobAction) Execute

func (j *JobAction) Execute(ctx Context) (*dpv1alpha1.ActionStatus, error)

func (*JobAction) GetName

func (j *JobAction) GetName() string

func (*JobAction) Type

func (j *JobAction) Type() dpv1alpha1.ActionType

type PersistentVolumeClaimWrapper

type PersistentVolumeClaimWrapper struct {
	VolumeName            string
	PersistentVolumeClaim corev1.PersistentVolumeClaim
}

func NewPersistentVolumeClaimWrapper

func NewPersistentVolumeClaimWrapper(pvc corev1.PersistentVolumeClaim, volumeName string) PersistentVolumeClaimWrapper

Jump to

Keyboard shortcuts

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