kubeobjects

package
v0.0.0-...-4563fb3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestsMapKeyedByName

func RequestsMapKeyedByName(requestsStruct Requests) map[string]Request

Types

type CaptureSpec

type CaptureSpec struct {
	//+optional
	Name string `json:"name,omitempty"`
	Spec `json:",inline"`
}

type Check

type Check struct {
	// Name of the check. Needs to be unique within the hook
	Name string `json:"name"`
	// The condition to check for
	Condition string `json:"condition,omitempty"`
	// How to handle when check does not become true. Defaults to Fail.
	OnError string `json:"onError,omitempty"`
	// How long to wait for the check to execute, in seconds
	Timeout int `json:"timeout,omitempty"`
}

type HookSpec

type HookSpec struct {
	Name           string                `json:"name"`
	Namespace      string                `json:"namespace"`
	Type           string                `json:"type"`
	SelectResource string                `json:"selectResource,omitempty"`
	LabelSelector  *metav1.LabelSelector `json:"labelSelector,omitempty"`
	NameSelector   string                `json:"nameSelector,omitempty"`
	SinglePodOnly  bool                  `json:"singlePodOnly,omitempty"`
	//+optional
	OnError string `json:"onError,omitempty"`

	//+optional
	Timeout   int   `json:"timeout,omitempty"`
	Essential *bool `json:"essential,omitempty"`

	Op Operation `json:"operation,omitempty"`

	Chk Check `json:"check,omitempty"`
}

HookSpec provides spec of either check or exec hook that needs to be executed

type KubeResourcesSpec

type KubeResourcesSpec struct {
	//+optional
	IncludedNamespaces []string `json:"includedNamespaces,omitempty"`
	//+optional
	IncludedResources []string `json:"includedResources,omitempty"`

	//+optional
	ExcludedResources []string `json:"excludedResources,omitempty"`

	//+optional
	Hook HookSpec `json:"hooks,omitempty"`

	//+optional
	IsHook bool `json:"isHook,omitempty"`
}

type Operation

type Operation struct {
	// Name of the operation. Needs to be unique within the hook
	Name string `json:"name"`
	// The container where the command should be executed
	Container string `json:"container,omitempty"`
	// The command to execute
	Command string `json:"command"`
	// How to handle command returning with non-zero exit code. Defaults to Fail.
	OnError string `json:"onError,omitempty"`
	// How long to wait for the command to execute, in seconds
	Timeout int `json:"timeout,omitempty"`
	// Name of another operation that reverts the effect of this operation (e.g. quiesce vs. unquiesce)
	InverseOp string `json:"inverseOp,omitempty"`
}

type ProtectRequest

type ProtectRequest interface{ Request }

type RecoverRequest

type RecoverRequest interface{ Request }

type RecoverSpec

type RecoverSpec struct {
	//+optional
	BackupName string `json:"backupName,omitempty"`
	Spec       `json:",inline"`
	//+optional
	NamespaceMapping map[string]string `json:"namespaceMapping,omitempty"`
	//+optional
	RestoreStatus *velero.RestoreStatusSpec `json:"restoreStatus,omitempty"`
	//+optional
	ExistingResourcePolicy velero.PolicyType `json:"existingResourcePolicy,omitempty"`
}

type Request

type Request interface {
	Object() client.Object
	Name() string
	StartTime() metav1.Time
	EndTime() metav1.Time
	Status(logr.Logger) error
	Deallocate(context.Context, client.Writer, logr.Logger) error
}

type RequestProcessingError

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

func RequestProcessingErrorCreate

func RequestProcessingErrorCreate(s string) RequestProcessingError

func (RequestProcessingError) Error

func (e RequestProcessingError) Error() string

func (RequestProcessingError) Is

func (RequestProcessingError) Is(target error) bool

Called by errors.Is() to match target.

type Requests

type Requests interface {
	Count() int
	Get(i int) Request
}

type RequestsManager

type RequestsManager interface {
	ProtectsPath() string
	RecoversPath() string
	ProtectRequestNew() ProtectRequest
	RecoverRequestNew() RecoverRequest
	ProtectRequestCreate(
		c context.Context, w client.Writer, l logr.Logger,
		s3Url string,
		s3BucketName string,
		s3RegionName string,
		s3KeyPrefix string,
		secretKeyRef *corev1.SecretKeySelector,
		caCertificates []byte,
		objectsSpec Spec,
		requestNamespaceName string,
		protectRequestName string,
		labels map[string]string,
		annotations map[string]string,
	) (ProtectRequest, error)
	RecoverRequestCreate(
		c context.Context, w client.Writer, l logr.Logger,
		s3Url string,
		s3BucketName string,
		s3RegionName string,
		s3KeyPrefix string,
		secretKeyRef *corev1.SecretKeySelector,
		caCertificates []byte,
		recoverSpec RecoverSpec,
		requestNamespaceName string,
		protectRequestName string,
		protectRequest ProtectRequest,
		recoverRequestName string,
		labels map[string]string,
		annotations map[string]string,
	) (RecoverRequest, error)
	ProtectRequestsGet(
		c context.Context, r client.Reader, requestNamespaceName string, labels map[string]string,
	) (Requests, error)
	RecoverRequestsGet(
		c context.Context, r client.Reader, requestNamespaceName string, labels map[string]string,
	) (Requests, error)
	ProtectRequestsDelete(c context.Context, w client.Writer, requestNamespaceName string, labels map[string]string) error
	RecoverRequestsDelete(c context.Context, w client.Writer, requestNamespaceName string, labels map[string]string) error
}

type Spec

type Spec struct {
	KubeResourcesSpec `json:",inline"`
	//+optional
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`

	//+optional
	OrLabelSelectors []*metav1.LabelSelector `json:"orLabelSelectors,omitempty"`

	//+optional
	IncludeClusterResources *bool `json:"includeClusterResources,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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