Documentation
¶
Index ¶
- func RequestsMapKeyedByName(requestsStruct Requests) map[string]Request
- type CaptureSpec
- type Check
- type HookSpec
- type KubeResourcesSpec
- type Operation
- type ProtectRequest
- type RecoverRequest
- type RecoverSpec
- type Request
- type RequestProcessingError
- type Requests
- type RequestsManager
- type ScaleSpec
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestsMapKeyedByName ¶
Types ¶
type CaptureSpec ¶
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"`
// Flag to skip a Hook.
SkipHookIfNotPresent bool `json:"skipHookIfNotPresent,omitempty"`
Op Operation `json:"operation,omitempty"`
Chk Check `json:"check,omitempty"`
Scale ScaleSpec `json:"scale,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"`
//+optional
GroupEssential *bool `json:"essential,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 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 RequestsManager ¶
type RequestsManager interface {
ProtectsPath() string
RecoversPath() string
ProtectRequestNew() ProtectRequest
RecoverRequestNew() RecoverRequest
ProtectRequestCreate(
c context.Context, w client.Client, 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.Client, 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"`
}
Click to show internal directories.
Click to hide internal directories.