v1beta1

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: Apache-2.0 Imports: 19 Imported by: 39

Documentation

Overview

+groupName=stash.appscode.com

Index

Constants

View Source
const (
	// ResourceVersion will be used to trigger restarts for ReplicaSet and RC pods
	StashKey = "stash.appscode.com"

	KeyBackupBlueprint = StashKey + "/backup-blueprint"
	KeyTargetPaths     = StashKey + "/target-paths"
	KeyVolumeMounts    = StashKey + "/volume-mounts"
	KeySchedule        = StashKey + "/schedule"
	KeyParams          = "params.stash.appscode.com"

	KeyLastAppliedBackupInvoker     = StashKey + "/last-applied-backup-invoker"
	KeyLastAppliedBackupInvokerKind = StashKey + "/last-applied-backup-invoker-kind"
	AppliedBackupInvokerSpecHash    = StashKey + "/last-applied-backup-invoker-hash"

	KeyLastAppliedRestoreInvoker     = StashKey + "/last-applied-restore-invoker"
	KeyLastAppliedRestoreInvokerKind = StashKey + "/last-applied-restore-invoker-kind"
	AppliedRestoreInvokerSpecHash    = StashKey + "/last-applied-restore-invoker-hash"
)
View Source
const (
	ResourceKindBackupBatch     = "BackupBatch"
	ResourceSingularBackupBatch = "backupbatch"
	ResourcePluralBackupBatch   = "backupbatches"
)
View Source
const (
	// GlobalPreBackupHookSucceeded indicates whether the global PreBackupHook was executed successfully or not
	GlobalPreBackupHookSucceeded = "GlobalPreBackupHookSucceeded"

	// GlobalPostBackupHookSucceeded indicates whether the global PostBackupHook was executed successfully or not
	GlobalPostBackupHookSucceeded = "GlobalPostBackupHookSucceeded"
)

=============================== Condition Types =============================

View Source
const (
	// GlobalPreBackupHookExecutedSuccessfully indicates that the condition transitioned to this state because the global PreBackupHook was executed successfully
	GlobalPreBackupHookExecutedSuccessfully = "GlobalPreBackupHookExecutedSuccessfully"
	// GlobalPreBackupHookExecutionFailed indicates that the condition transitioned to this state because the Stash was unable to execute global PreBackupHook
	GlobalPreBackupHookExecutionFailed = "GlobalPreBackupHookExecutionFailed"

	// GlobalPostBackupHookExecutedSuccessfully indicates that the condition transitioned to this state because the global PostBackupHook was executed successfully
	GlobalPostBackupHookExecutedSuccessfully = "GlobalPostBackupHookExecutedSuccessfully"
	// GlobalPostBackupHookExecutionFailed indicates that the condition transitioned to this state because the Stash was unable to execute global PostBackupHook
	GlobalPostBackupHookExecutionFailed = "GlobalPostBackupHookExecutionFailed"
)

============================== Condition Reasons ===========================

View Source
const (
	ResourceKindBackupBlueprint     = "BackupBlueprint"
	ResourcePluralBackupBlueprint   = "backupblueprints"
	ResourceSingularBackupBlueprint = "backupblueprint"
)
View Source
const (
	ResourceKindBackupConfiguration     = "BackupConfiguration"
	ResourceSingularBackupConfiguration = "backupconfiguration"
	ResourcePluralBackupConfiguration   = "backupconfigurations"
)
View Source
const (
	// BackupTargetFound indicates whether the backup target was found
	BackupTargetFound = "BackupTargetFound"

	// StashSidecarInjected indicates whether stash sidecar was injected into the targeted workload
	// This condition is applicable only for sidecar model
	StashSidecarInjected = "StashSidecarInjected"

	// CronJobCreated indicates whether the backup triggering CronJob was created
	CronJobCreated = "CronJobCreated"

	// RepositoryFound indicates whether the respective Repository object was found or not.
	RepositoryFound = "RepositoryFound"

	// BackendSecretFound indicates whether the respective backend secret was found or not.
	BackendSecretFound = "BackendSecretFound"

	// ValidationPassed indicates the validation conditions of the CRD are passed or not.
	ValidationPassed = "ValidationPassed"
)

==================== Condition Types ============================

View Source
const (
	// TargetAvailable indicates that the condition transitioned to this state because the target was available
	TargetAvailable = "TargetAvailable"
	// TargetNotAvailable indicates that the condition transitioned to this state because the target was not available
	TargetNotAvailable = "TargetNotAvailable"
	// UnableToCheckTargetAvailability indicates that the condition transitioned to this state because operator was unable
	// to check the target availability
	UnableToCheckTargetAvailability = "UnableToCheckTargetAvailability"

	// SidecarInjectionSucceeded indicates that the condition transitioned to this state because sidecar was injected
	// successfully into the targeted workload
	SidecarInjectionSucceeded = "SidecarInjectionSucceeded"
	// SidecarInjectionFailed indicates that the condition transitioned to this state because operator was unable
	// to inject sidecar into the targeted workload
	SidecarInjectionFailed = "SidecarInjectionFailed"

	// CronJobCreationSucceeded indicates that the condition transitioned to this state because backup triggering CronJob was created successfully
	CronJobCreationSucceeded = "CronJobCreationSucceeded"
	// CronJobCreationFailed indicates that the condition transitioned to this state because operator was unable to create backup triggering CronJob
	CronJobCreationFailed = "CronJobCreationFailed"

	// RepositoryAvailable indicates that the condition transitioned to this state because the Repository was available
	RepositoryAvailable = "RepositoryAvailable"
	// RepositoryNotAvailable indicates that the condition transitioned to this state because the Repository was not available
	RepositoryNotAvailable = "RepositoryNotAvailable"
	// UnableToCheckRepositoryAvailability indicates that the condition transitioned to this state because operator was unable
	// to check the Repository availability
	UnableToCheckRepositoryAvailability = "UnableToCheckRepositoryAvailability"

	// BackendSecretAvailable indicates that the condition transitioned to this state because the backend Secret was available
	BackendSecretAvailable = "BackendSecretAvailable"
	// BackendSecretNotAvailable indicates that the condition transitioned to this state because the backend Secret was not available
	BackendSecretNotAvailable = "BackendSecretNotAvailable"
	// UnableToCheckBackendSecretAvailability indicates that the condition transitioned to this state because operator was unable
	// to check the backend Secret availability
	UnableToCheckBackendSecretAvailability = "UnableToCheckBackendSecretAvailability"

	// ResourceValidationPassed indicates that the condition transitioned to this state because the CRD meets validation criteria
	ResourceValidationPassed = "ResourceValidationPassed"
	// ResourceValidationFailed indicates that the condition transitioned to this state because the CRD does not meet validation criteria
	ResourceValidationFailed = "ResourceValidationFailed"
)

======================= Condition Reasons ===========================

View Source
const (
	ResourceKindBackupSession     = "BackupSession"
	ResourceSingularBackupSession = "backupsession"
	ResourcePluralBackupSession   = "backupsessions"
)
View Source
const (
	ApplyRetentionPolicy      = "ApplyRetentionPolicy"
	VerifyRepositoryIntegrity = "VerifyRepositoryIntegrity"
	SendRepositoryMetrics     = "SendRepositoryMetrics"
)

============================== Post-backup Actions ==========================

View Source
const (
	// RetentionPolicyApplied indicates that whether the retention policies were applied or not
	RetentionPolicyApplied = "RetentionPolicyApplied"

	// BackendRepositoryInitialized indicates that whether backend repository was initialized or not
	BackendRepositoryInitialized = "BackendRepositoryInitialized"

	// RepositoryIntegrityVerified indicates whether the repository integrity check succeeded or not
	RepositoryIntegrityVerified = "RepositoryIntegrityVerified"

	// RepositoryMetricsPushed indicates whether the Repository metrics for this backup session were pushed or not
	RepositoryMetricsPushed = "RepositoryMetricsPushed"

	// BackupSkipped indicates that the current session was skipped
	BackupSkipped = "BackupSkipped"

	// BackupHistoryCleaned indicates whether the backup history was cleaned or not according to backupHistoryLimit
	BackupHistoryCleaned = "BackupHistoryCleaned"

	// BackupExecutorEnsured indicates whether the backup executor entity was created or not
	BackupExecutorEnsured = "BackupExecutorEnsured"

	// PreBackupHookExecutionSucceeded indicates whether the preBackup hook was executed successfully or not
	PreBackupHookExecutionSucceeded = "PreBackupHookExecutionSucceeded"

	// PostBackupHookExecutionSucceeded indicates whether the postBackup hook was executed successfully or not
	PostBackupHookExecutionSucceeded = "PostBackupHookExecutionSucceeded"

	// DeadlineExceeded  indicates whether the session deadline was exceeded or not
	DeadlineExceeded = "DeadlineExceeded"
)

============================ Condition Types ========================

View Source
const (
	// SuccessfullyAppliedRetentionPolicy indicates that the condition transitioned to this state because the retention policies was applied successfully
	SuccessfullyAppliedRetentionPolicy = "SuccessfullyAppliedRetentionPolicy"
	// FailedToApplyRetentionPolicy indicates that the condition transitioned to this state because the Stash was unable to apply the retention policies
	FailedToApplyRetentionPolicy = "FailedToApplyRetentionPolicy"

	// BackendRepositoryFound indicates that the condition transitioned to this state because the restic repository was found in the backend
	BackendRepositoryFound = "BackendRepositoryFound"
	// FailedToInitializeBackendRepository indicates that the condition transitioned to this state because the Stash was unable to initialize a repository in the backend
	FailedToInitializeBackendRepository = "FailedToInitializeBackendRepository"

	// SuccessfullyVerifiedRepositoryIntegrity indicates that the condition transitioned to this state because the repository has passed the integrity check
	SuccessfullyVerifiedRepositoryIntegrity = "SuccessfullyVerifiedRepositoryIntegrity"
	// FailedToVerifyRepositoryIntegrity indicates that the condition transitioned to this state because the repository has failed the integrity check
	FailedToVerifyRepositoryIntegrity = "FailedToVerifyRepositoryIntegrity"

	// SuccessfullyPushedRepositoryMetrics indicates that the condition transitioned to this state because the repository metrics was successfully pushed to the pushgateway
	SuccessfullyPushedRepositoryMetrics = "SuccessfullyPushedRepositoryMetrics"
	// FailedToPushRepositoryMetrics indicates that the condition transitioned to this state because the Stash was unable to push the repository metrics to the pushgateway
	FailedToPushRepositoryMetrics = "FailedToPushRepositoryMetrics"

	// SkippedTakingNewBackup indicates that the backup was skipped because another backup was running or backup invoker is not ready state.
	SkippedTakingNewBackup = "SkippedTakingNewBackup"

	SuccessfullyCleanedBackupHistory = "SuccessfullyCleanedBackupHistory"
	FailedToCleanBackupHistory       = "FailedToCleanBackupHistory"

	SuccessfullyEnsuredBackupExecutor = "SuccessfullyEnsuredBackupExecutor"
	FailedToEnsureBackupExecutor      = "FailedToEnsureBackupExecutor"

	SuccessfullyExecutedPreBackupHook = "SuccessfullyExecutedPreBackupHook"
	FailedToExecutePreBackupHook      = "FailedToExecutePreBackupHook"

	SuccessfullyExecutedPostBackupHook = "SuccessfullyExecutedPostBackupHook"
	FailedToExecutePostBackupHook      = "FailedToExecutePostBackupHook"

	FailedToCompleteWithinDeadline = "FailedToCompleteWithinDeadline"
)

=========================== Condition Reasons =======================

View Source
const (
	ResourceKindFunction     = "Function"
	ResourcePluralFunction   = "functions"
	ResourceSingularFunction = "function"
)
View Source
const (
	ResourceKindRestoreBatch     = "RestoreBatch"
	ResourceSingularRestoreBatch = "restorebatch"
	ResourcePluralRestoreBatch   = "restorebatches"
)
View Source
const (
	// GlobalPreRestoreHookSucceeded indicates whether the global PreRestoreHook was executed successfully or not
	GlobalPreRestoreHookSucceeded = "GlobalPreRestoreHookSucceeded"

	// GlobalPostRestoreHookSucceeded indicates whether the global PostRestoreHook was executed successfully or not
	GlobalPostRestoreHookSucceeded = "GlobalPostRestoreHookSucceeded"
)

=============================== Condition Types =====================================

View Source
const (
	// GlobalPreRestoreHookExecutedSuccessfully indicates that the condition transitioned to this state because the global PreRestoreHook was executed successfully
	GlobalPreRestoreHookExecutedSuccessfully = "GlobalPreRestoreHookExecutedSuccessfully"
	// GlobalPreRestoreHookExecutionFailed indicates that the condition transitioned to this state because the Stash was unable to execute global PreRestoreHook
	GlobalPreRestoreHookExecutionFailed = "GlobalPreRestoreHookExecutionFailed"

	// GlobalPostRestoreHookExecutedSuccessfully indicates that the condition transitioned to this state because the global PostRestoreHook was executed successfully
	GlobalPostRestoreHookExecutedSuccessfully = "GlobalPostRestoreHookExecutedSuccessfully"
	// GlobalPostRestoreHookExecutionFailed indicates that the condition transitioned to this state because the Stash was unable to execute global PostRestoreHook
	GlobalPostRestoreHookExecutionFailed = "GlobalPostRestoreHookExecutionFailed"
)

============================== Condition Reasons ===================================

View Source
const (
	ResourceKindRestoreSession     = "RestoreSession"
	ResourcePluralRestoreSession   = "restoresessions"
	ResourceSingularRestoreSession = "restoresession"
)
View Source
const (
	// RestoreTargetFound indicates whether the restore target was found
	RestoreTargetFound = "RestoreTargetFound"

	// StashInitContainerInjected indicates whether stash init-container was injected into the targeted workload
	// This condition is applicable only for sidecar model
	StashInitContainerInjected = "StashInitContainerInjected"

	// RestoreJobCreated indicates whether the restore job was created
	RestoreJobCreated = "RestoreJobCreated"

	// RestoreCompleted condition indicates whether the restore process has been completed or not.
	// This condition is particularly helpful when the restore addon require some additional operations to perform
	// before marking the RestoreSession Succeeded/Failed.
	RestoreCompleted = "RestoreCompleted"

	// RestoreExecutorEnsured condition indicates whether the restore job / init-container was ensured or not.
	RestoreExecutorEnsured = "RestoreExecutorEnsured"

	// MetricsPushed whether the metrics for this backup session were pushed or not
	MetricsPushed = "MetricsPushed"

	// PreRestoreHookExecutionSucceeded indicates whether the preRestore hook was executed successfully or not
	PreRestoreHookExecutionSucceeded = "PreRestoreHookExecutionSucceeded"

	// PostRestoreHookExecutionSucceeded indicates whether the postRestore hook was executed successfully or not
	PostRestoreHookExecutionSucceeded = "PostRestoreHookExecutionSucceeded"
)

========================= Condition Types ===================

View Source
const (
	// InitContainerInjectionSucceeded indicates that the condition transitioned to this state because stash init-container
	// was injected successfully into the targeted workload
	InitContainerInjectionSucceeded = "InitContainerInjectionSucceeded"
	// InitContainerInjectionFailed indicates that the condition transitioned to this state because operator was unable
	// to inject stash init-container into the targeted workload
	InitContainerInjectionFailed = "InitContainerInjectionFailed"

	// RestoreJobCreationSucceeded indicates that the condition transitioned to this state because restore job was created successfully
	RestoreJobCreationSucceeded = "RestoreJobCreationSucceeded"
	// RestoreJobCreationFailed indicates that the condition transitioned to this state because operator was unable to create restore job
	RestoreJobCreationFailed = "RestoreJobCreationFailed"

	// SuccessfullyPushedMetrics indicates that the condition transitioned to this state because the metrics was successfully pushed to the pushgateway
	SuccessfullyPushedMetrics = "SuccessfullyPushedMetrics"
	// FailedToPushMetrics indicates that the condition transitioned to this state because the Stash was unable to push the metrics to the pushgateway
	FailedToPushMetrics = "FailedToPushMetrics"

	SuccessfullyEnsuredRestoreExecutor = "SuccessfullyEnsuredRestoreExecutor"
	FailedToEnsureRestoreExecutor      = "FailedToEnsureRestoreExecutor"

	SuccessfullyExecutedPreRestoreHook = "SuccessfullyExecutedPreRestoreHook"
	FailedToExecutePreRestoreHook      = "FailedToExecutePreRestoreHook"

	SuccessfullyExecutedPostRestoreHook = "SuccessfullyExecutedPostRestoreHook"
	FailedToExecutePostRestoreHook      = "FailedToExecutePostRestoreHook"

	PostRestoreTasksExecuted    = "PostRestoreTasksExecuted"
	PostRestoreTasksNotExecuted = "PostRestoreTasksNotExecuted"
)

======================== Condition Reasons ===================

View Source
const (
	ResourceKindTask     = "Task"
	ResourcePluralTask   = "tasks"
	ResourceSingularTask = "task"
)
View Source
const (
	StashBackupComponent  = "stash-backup"
	StashRestoreComponent = "stash-restore"
	TargetKindEmpty       = "EmptyTarget"
)
View Source
const (
	InitializeBackendRepository = "InitializeBackendRepository"
)

=============================== Pre-backup Actions ============================

Variables

View Source
var (
	// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: stash.GroupName, Version: "v1beta1"}

Functions

func GetOpenAPIDefinitionsWithRetentionPolicy

func GetOpenAPIDefinitionsWithRetentionPolicy(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type BackupBatch

type BackupBatch struct {
	metav1.TypeMeta   `json:",inline,omitempty"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              BackupBatchSpec   `json:"spec,omitempty"`
	Status            BackupBatchStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:path=backupbatches,singular=backupbatch,categories={stash,appscode,all} +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Schedule",type="string",JSONPath=".spec.schedule" +kubebuilder:printcolumn:name="Paused",type="boolean",JSONPath=".spec.paused" +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (BackupBatch) CustomResourceDefinition

func (_ BackupBatch) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*BackupBatch) DeepCopy

func (in *BackupBatch) DeepCopy() *BackupBatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupBatch.

func (*BackupBatch) DeepCopyInto

func (in *BackupBatch) DeepCopyInto(out *BackupBatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupBatch) DeepCopyObject

func (in *BackupBatch) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (BackupBatch) GetSpecHash

func (b BackupBatch) GetSpecHash() string

func (BackupBatch) OffshootLabels

func (b BackupBatch) OffshootLabels() map[string]string

OffshootLabels return labels consist of the labels provided by user to BackupBatch crd and stash specific generic labels. It overwrites the the user provided labels if it matched with stash specific generic labels.

type BackupBatchList

type BackupBatchList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []BackupBatch `json:"items,omitempty"`
}

func (*BackupBatchList) DeepCopy

func (in *BackupBatchList) DeepCopy() *BackupBatchList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupBatchList.

func (*BackupBatchList) DeepCopyInto

func (in *BackupBatchList) DeepCopyInto(out *BackupBatchList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupBatchList) DeepCopyObject

func (in *BackupBatchList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupBatchSpec

type BackupBatchSpec struct {
	// members is a list of backup configurations that are part of this batch
	// +optional
	Members []BackupConfigurationTemplateSpec `json:"members,omitempty"`
	// Schedule specifies the schedule for invoking backup sessions
	// +optional
	Schedule string `json:"schedule,omitempty"`
	// RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc,
	// and used to create service account for CronJob.
	// +optional
	RuntimeSettings ofst.RuntimeSettings `json:"runtimeSettings,omitempty"`
	// Driver indicates the name of the agent to use to backup the target.
	// Supported values are "Restic", "VolumeSnapshotter".
	// Default value is "Restic".
	// +optional
	// +kubebuilder:default=Restic
	Driver Snapshotter `json:"driver,omitempty"`
	// Repository refer to the Repository crd that holds backend information
	// +optional
	Repository kmapi.ObjectReference `json:"repository,omitempty"`
	// RetentionPolicy indicates the policy to follow to clean old backup snapshots
	RetentionPolicy v1alpha1.RetentionPolicy `json:"retentionPolicy"`
	// Indicates that the BackupConfiguration is paused from taking backup. Default value is 'false'
	// +optional
	Paused bool `json:"paused,omitempty"`
	// BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep.
	// This is helpful for debugging purpose.
	// Default: 1
	// +optional
	BackupHistoryLimit *int32 `json:"backupHistoryLimit,omitempty"`
	// Actions that Stash should take in response to backup sessions.
	// Cannot be updated.
	// +optional
	Hooks *BackupHooks `json:"hooks,omitempty"`
	// ExecutionOrder indicate whether to backup the members in the sequential order as they appear in the members list.
	// The default value is "Parallel" which means the members will be backed up in parallel.
	// +kubebuilder:default=Parallel
	// +optional
	ExecutionOrder ExecutionOrder `json:"executionOrder,omitempty"`
	// TimeOut specifies the maximum duration of backup. BackupBatch will be considered Failed
	// if backup does not complete within this time limit. By default, Stash don't set any timeout for backup.
	// +optional
	TimeOut *metav1.Duration `json:"timeOut,omitempty"`

	// RetryConfig specify a configuration for retry a backup if it fails.
	// By default, Stash does not retry any failed backup.
	// +optional
	RetryConfig *RetryConfig `json:"retryConfig,omitempty"`
}

func (*BackupBatchSpec) DeepCopy

func (in *BackupBatchSpec) DeepCopy() *BackupBatchSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupBatchSpec.

func (*BackupBatchSpec) DeepCopyInto

func (in *BackupBatchSpec) DeepCopyInto(out *BackupBatchSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupBatchStatus

type BackupBatchStatus struct {
	// ObservedGeneration is the most recent generation observed for this BackupBatch. It corresponds to the
	// BackupBatch's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// Conditions shows current backup setup condition of the BackupBatch.
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
	// MemberConditions shows current backup setup condition of the members of the BackupBatch.
	// +optional
	MemberConditions []MemberConditions `json:"memberConditions,omitempty"`
	// Phase indicates phase of this BackupBatch.
	// +optional
	Phase BackupInvokerPhase `json:"phase,omitempty"`
}

func (*BackupBatchStatus) DeepCopy

func (in *BackupBatchStatus) DeepCopy() *BackupBatchStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupBatchStatus.

func (*BackupBatchStatus) DeepCopyInto

func (in *BackupBatchStatus) DeepCopyInto(out *BackupBatchStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupBlueprint

type BackupBlueprint struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              BackupBlueprintSpec `json:"spec,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:path=backupblueprints,singular=backupblueprint,scope=Cluster,shortName=bb,categories={stash,appscode} +kubebuilder:printcolumn:name="Task",type="string",JSONPath=".spec.task.name" +kubebuilder:printcolumn:name="Schedule",type="string",JSONPath=".spec.schedule" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (BackupBlueprint) CustomResourceDefinition

func (_ BackupBlueprint) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*BackupBlueprint) DeepCopy

func (in *BackupBlueprint) DeepCopy() *BackupBlueprint

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupBlueprint.

func (*BackupBlueprint) DeepCopyInto

func (in *BackupBlueprint) DeepCopyInto(out *BackupBlueprint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupBlueprint) DeepCopyObject

func (in *BackupBlueprint) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (BackupBlueprint) GetSpecHash

func (bb BackupBlueprint) GetSpecHash() string

type BackupBlueprintList

type BackupBlueprintList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []BackupBlueprint `json:"items,omitempty"`
}

func (*BackupBlueprintList) DeepCopy

func (in *BackupBlueprintList) DeepCopy() *BackupBlueprintList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupBlueprintList.

func (*BackupBlueprintList) DeepCopyInto

func (in *BackupBlueprintList) DeepCopyInto(out *BackupBlueprintList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupBlueprintList) DeepCopyObject

func (in *BackupBlueprintList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupBlueprintSpec

type BackupBlueprintSpec struct {
	// RepositorySpec is used to create Repository crd for respective workload
	v1alpha1.RepositorySpec `json:",inline"`
	// BackupNamespace specifies the namespace where the backup resources (i.e. BackupConfiguration, BackupSession, Job, Repository etc.) will be created.
	// If you don't provide this field, then the backup resources will be created in the target namespace.
	// +optional
	BackupNamespace string `json:"backupNamespace,omitempty"`
	// RepoNamespace lets you specify the namespace for the Repositories. If this field is not specified, Stash will create the Repository
	// in the namespace pointed by the backupNamespace field. If neither of the backupNamespace and repoNamespace is specified,
	// Stash will create the Repository in the target namespace.
	// +optional
	RepoNamespace string `json:"repoNamespace,omitempty"`
	// Schedule specifies the default schedule for backup.
	// You can overwrite this schedule for a particular target using 'stash.appscode.com/schedule' annotation.
	Schedule string `json:"schedule,omitempty"`
	// Task specify the Task crd that specifies steps for backup process
	// +optional
	Task TaskRef `json:"task,omitempty"`
	// RetentionPolicy indicates the policy to follow to clean old backup snapshots
	RetentionPolicy v1alpha1.RetentionPolicy `json:"retentionPolicy"`
	// RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc.
	// +optional
	RuntimeSettings ofst.RuntimeSettings `json:"runtimeSettings,omitempty"`
	// Temp directory configuration for functions/sidecar
	// An `EmptyDir` will always be mounted at /tmp with this settings
	// +optional
	TempDir EmptyDirSettings `json:"tempDir,omitempty"`
	// InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily
	// before uploading to backend or inserting into target. It is only usable for job model.
	// Don't specify it in sidecar model.
	// +optional
	InterimVolumeTemplate *ofst.PersistentVolumeClaim `json:"interimVolumeTemplate,omitempty"`
	// Hooks specifies the actions Stash should execute before or after backup.
	// +optional
	Hooks *BackupHooks `json:"hooks,omitempty"`
	// BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep.
	// This is helpful for debugging purpose.
	// Default: 1
	// +optional
	BackupHistoryLimit *int32 `json:"backupHistoryLimit,omitempty"`
	// TimeOut specifies the maximum duration of backup. BackupSession will be considered Failed
	// if backup does not complete within this time limit. By default, Stash don't set any timeout for backup.
	// +optional
	TimeOut *metav1.Duration `json:"timeOut,omitempty"`

	// RetryConfig specify a configuration for retry a backup if it fails.
	// By default, Stash does not retry any failed backup.
	// +optional
	RetryConfig *RetryConfig `json:"retryConfig,omitempty"`
}

func (*BackupBlueprintSpec) DeepCopy

func (in *BackupBlueprintSpec) DeepCopy() *BackupBlueprintSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupBlueprintSpec.

func (*BackupBlueprintSpec) DeepCopyInto

func (in *BackupBlueprintSpec) DeepCopyInto(out *BackupBlueprintSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupConfiguration

type BackupConfiguration struct {
	metav1.TypeMeta   `json:",inline,omitempty"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              BackupConfigurationSpec   `json:"spec,omitempty"`
	Status            BackupConfigurationStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:path=backupconfigurations,singular=backupconfiguration,shortName=bc,categories={stash,appscode,all} +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Task",type="string",JSONPath=".spec.task.name" +kubebuilder:printcolumn:name="Schedule",type="string",JSONPath=".spec.schedule" +kubebuilder:printcolumn:name="Paused",type="boolean",JSONPath=".spec.paused" +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (BackupConfiguration) CustomResourceDefinition

func (_ BackupConfiguration) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*BackupConfiguration) DeepCopy

func (in *BackupConfiguration) DeepCopy() *BackupConfiguration

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfiguration.

func (*BackupConfiguration) DeepCopyInto

func (in *BackupConfiguration) DeepCopyInto(out *BackupConfiguration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupConfiguration) DeepCopyObject

func (in *BackupConfiguration) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (BackupConfiguration) GetSpecHash

func (b BackupConfiguration) GetSpecHash() string

func (BackupConfiguration) OffshootLabels

func (b BackupConfiguration) OffshootLabels() map[string]string

OffshootLabels return labels consist of the labels provided by user to BackupConfiguration crd and stash specific generic labels. It overwrites the the user provided labels if it matched with stash specific generic labels.

type BackupConfigurationList

type BackupConfigurationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []BackupConfiguration `json:"items,omitempty"`
}

func (*BackupConfigurationList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfigurationList.

func (*BackupConfigurationList) DeepCopyInto

func (in *BackupConfigurationList) DeepCopyInto(out *BackupConfigurationList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupConfigurationList) DeepCopyObject

func (in *BackupConfigurationList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupConfigurationSpec

type BackupConfigurationSpec struct {
	BackupConfigurationTemplateSpec `json:",inline,omitempty"`
	// Schedule specifies the schedule for invoking backup sessions
	// +optional
	Schedule string `json:"schedule,omitempty"`
	// Driver indicates the name of the agent to use to backup the target.
	// Supported values are "Restic", "VolumeSnapshotter".
	// Default value is "Restic".
	// +optional
	// +kubebuilder:default=Restic
	Driver Snapshotter `json:"driver,omitempty"`
	// Repository refer to the Repository crd that holds backend information
	// +optional
	Repository kmapi.ObjectReference `json:"repository,omitempty"`
	// RetentionPolicy indicates the policy to follow to clean old backup snapshots
	RetentionPolicy v1alpha1.RetentionPolicy `json:"retentionPolicy"`
	// Indicates that the BackupConfiguration is paused from taking backup. Default value is 'false'
	// +optional
	Paused bool `json:"paused,omitempty"`
	// BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep.
	// This is helpful for debugging purpose.
	// Default: 1
	// +optional
	BackupHistoryLimit *int32 `json:"backupHistoryLimit,omitempty"`
	// TimeOut specifies the maximum duration of backup. BackupSession will be considered Failed
	// if backup does not complete within this time limit. By default, Stash don't set any timeout for backup.
	// +optional
	TimeOut *metav1.Duration `json:"timeOut,omitempty"`

	// RetryConfig specify a configuration for retry a backup if it fails.
	// By default, Stash does not retry any failed backup.
	// +optional
	RetryConfig *RetryConfig `json:"retryConfig,omitempty"`
}

func (*BackupConfigurationSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfigurationSpec.

func (*BackupConfigurationSpec) DeepCopyInto

func (in *BackupConfigurationSpec) DeepCopyInto(out *BackupConfigurationSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupConfigurationStatus

type BackupConfigurationStatus struct {
	// ObservedGeneration is the most recent generation observed for this BackupConfiguration. It corresponds to the
	// BackupConfiguration's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// Conditions shows current backup setup condition of the BackupConfiguration.
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
	// Phase indicates phase of this BackupConfiguration.
	// +optional
	Phase BackupInvokerPhase `json:"phase,omitempty"`
}

func (*BackupConfigurationStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfigurationStatus.

func (*BackupConfigurationStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupConfigurationTemplateSpec

type BackupConfigurationTemplateSpec struct {
	// Task specify the Task crd that specifies the steps to take backup
	// +optional
	Task TaskRef `json:"task,omitempty"`
	// Target specify the backup target
	// +optional
	Target *BackupTarget `json:"target,omitempty"`
	// RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc.
	// +optional
	RuntimeSettings ofst.RuntimeSettings `json:"runtimeSettings,omitempty"`
	// Temp directory configuration for functions/sidecar
	// An `EmptyDir` will always be mounted at /tmp with this settings
	// +optional
	TempDir EmptyDirSettings `json:"tempDir,omitempty"`
	// InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily
	// before uploading to backend or inserting into target. It is only usable for job model.
	// Don't specify it in sidecar model.
	// +optional
	InterimVolumeTemplate *ofst.PersistentVolumeClaim `json:"interimVolumeTemplate,omitempty"`
	// Actions that Stash should take in response to backup sessions.
	// +optional
	Hooks *BackupHooks `json:"hooks,omitempty"`
}

func (*BackupConfigurationTemplateSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfigurationTemplateSpec.

func (*BackupConfigurationTemplateSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupHooks

type BackupHooks struct {
	// PreBackup is called immediately before a backup session is initiated.
	// +optional
	PreBackup *prober.Handler `json:"preBackup,omitempty"`

	// PostBackup is called according to executionPolicy after a backup session is complete.
	// +optional
	PostBackup *PostBackupHook `json:"postBackup,omitempty"`
}

Hooks describes actions that Stash should take in response to backup sessions. For the PostBackup and PreBackup handlers, backup process blocks until the action is complete, unless the container process fails, in which case the handler is aborted.

func (*BackupHooks) DeepCopy

func (in *BackupHooks) DeepCopy() *BackupHooks

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupHooks.

func (*BackupHooks) DeepCopyInto

func (in *BackupHooks) DeepCopyInto(out *BackupHooks)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupInvokerPhase added in v0.18.0

type BackupInvokerPhase string

+kubebuilder:validation:Enum=Invalid;Ready;NotReady

const (
	BackupInvokerInvalid  BackupInvokerPhase = "Invalid"
	BackupInvokerReady    BackupInvokerPhase = "Ready"
	BackupInvokerNotReady BackupInvokerPhase = "NotReady"
)

type BackupInvokerRef

type BackupInvokerRef struct {
	// APIGroup is the group for the resource being referenced
	// +optional
	APIGroup string `json:"apiGroup,omitempty"`
	// Kind is the type of resource being referenced
	Kind string `json:"kind"`
	// Name is the name of resource being referenced
	Name string `json:"name"`
}

BackupInvokerRef contains information that points to the backup configuration or batch being used

func (*BackupInvokerRef) DeepCopy

func (in *BackupInvokerRef) DeepCopy() *BackupInvokerRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupInvokerRef.

func (*BackupInvokerRef) DeepCopyInto

func (in *BackupInvokerRef) DeepCopyInto(out *BackupInvokerRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupSession

type BackupSession struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              BackupSessionSpec   `json:"spec,omitempty"`
	Status            BackupSessionStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:path=backupsessions,singular=backupsession,categories={stash,appscode,all} +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Invoker-Type",type="string",JSONPath=".spec.invoker.kind" +kubebuilder:printcolumn:name="Invoker-Name",type="string",JSONPath=".spec.invoker.name" +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +kubebuilder:printcolumn:name="Duration",type="string",JSONPath=".status.sessionDuration" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (BackupSession) CustomResourceDefinition

func (_ BackupSession) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*BackupSession) DeepCopy

func (in *BackupSession) DeepCopy() *BackupSession

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSession.

func (*BackupSession) DeepCopyInto

func (in *BackupSession) DeepCopyInto(out *BackupSession)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupSession) DeepCopyObject

func (in *BackupSession) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (BackupSession) GetSpecHash

func (bs BackupSession) GetSpecHash() string

func (BackupSession) IsValid

func (r BackupSession) IsValid() error

TODO: complete

type BackupSessionList

type BackupSessionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []BackupSession `json:"items,omitempty"`
}

func (*BackupSessionList) DeepCopy

func (in *BackupSessionList) DeepCopy() *BackupSessionList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSessionList.

func (*BackupSessionList) DeepCopyInto

func (in *BackupSessionList) DeepCopyInto(out *BackupSessionList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupSessionList) DeepCopyObject

func (in *BackupSessionList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupSessionPhase

type BackupSessionPhase string

+kubebuilder:validation:Enum=Pending;Skipped;Running;Succeeded;Failed;Unknown

const (
	BackupSessionPending   BackupSessionPhase = "Pending"
	BackupSessionSkipped   BackupSessionPhase = "Skipped"
	BackupSessionRunning   BackupSessionPhase = "Running"
	BackupSessionSucceeded BackupSessionPhase = "Succeeded"
	BackupSessionFailed    BackupSessionPhase = "Failed"
	BackupSessionUnknown   BackupSessionPhase = "Unknown"
)

type BackupSessionSpec

type BackupSessionSpec struct {
	// Invoker refers to the BackupConfiguration or BackupBatch being used to invoke this backup session
	// +optional
	Invoker BackupInvokerRef `json:"invoker,omitempty"`

	// RetryLeft specifies number of retry attempts left for the session.
	// If this set to non-zero, Stash will create a new BackupSession if the current one fails.
	// +optional
	RetryLeft int32 `json:"retryLeft,omitempty"`
}

func (*BackupSessionSpec) DeepCopy

func (in *BackupSessionSpec) DeepCopy() *BackupSessionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSessionSpec.

func (*BackupSessionSpec) DeepCopyInto

func (in *BackupSessionSpec) DeepCopyInto(out *BackupSessionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupSessionStatus

type BackupSessionStatus struct {
	// Phase indicates the overall phase of the backup process for this BackupSession. Phase will be "Succeeded" only if
	// phase of all hosts are "Succeeded". If any of the host fail to complete backup, Phase will be "Failed".
	// +optional
	Phase BackupSessionPhase `json:"phase,omitempty"`
	// SessionDuration specify total time taken to complete current backup session (sum of backup duration of all targets)
	// +optional
	SessionDuration string `json:"sessionDuration,omitempty"`
	// Targets specify the backup status of individual targets
	// +optional
	Targets []BackupTargetStatus `json:"targets,omitempty"`
	// Conditions shows condition of different operations/steps of the backup process
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
	// SessionDeadline specifies the deadline of backup. BackupSession will be
	// considered Failed if backup does not complete within this deadline
	// +optional
	SessionDeadline *metav1.Time `json:"sessionDeadline,omitempty"`

	// Retried specifies whether this session was retried or not.
	// This field will exist only if the `retryConfig` has been set in the respective backup invoker.
	// +optional
	Retried *bool `json:"retried,omitempty"`

	// NextRetry specifies the time when Stash should retry the current failed backup.
	// This field will exist only if the `retryConfig` has been set in the respective backup invoker.
	// +optional
	NextRetry *metav1.Time `json:"nextRetry,omitempty"`
}

func (*BackupSessionStatus) DeepCopy

func (in *BackupSessionStatus) DeepCopy() *BackupSessionStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSessionStatus.

func (*BackupSessionStatus) DeepCopyInto

func (in *BackupSessionStatus) DeepCopyInto(out *BackupSessionStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupTarget

type BackupTarget struct {
	// Alias represents the identifier of the backed up data in the repository.
	// This will be used as `hostname` or will be used to generate the `hostname` for the restic repository.
	// +optional
	Alias string `json:"alias,omitempty"`
	// Ref refers to the backup target
	Ref TargetRef `json:"ref,omitempty"`
	// Paths specify the file paths to backup
	// +optional
	Paths []string `json:"paths,omitempty"`
	// VolumeMounts specifies the volumes to mount inside stash sidecar/init container
	// Specify the volumes that contains the target directories
	// +optional
	VolumeMounts []core.VolumeMount `json:"volumeMounts,omitempty"`
	// replicas are the desired number of replicas whose data should be backed up.
	// If unspecified, defaults to 1.
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`
	// Name of the VolumeSnapshotClass used by the VolumeSnapshot. If not specified, a default snapshot class will be used if it is available.
	// Use this field only if the "driver" field is set to "volumeSnapshotter".
	// +optional
	VolumeSnapshotClassName string `json:"snapshotClassName,omitempty"`
	// Exclude specifies a list of patterns for the files to ignore during backup.
	// Stash will ignore those files that match the specified patterns.
	// Supported only for "Restic" driver
	// +optional
	Exclude []string `json:"exclude,omitempty"`
	// Args specifies a list of arguments to pass to the backup driver.
	// +optional
	Args []string `json:"args,omitempty"`
}

func (*BackupTarget) DeepCopy

func (in *BackupTarget) DeepCopy() *BackupTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupTarget.

func (*BackupTarget) DeepCopyInto

func (in *BackupTarget) DeepCopyInto(out *BackupTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupTargetStatus

type BackupTargetStatus struct {
	// Ref refers to the backup target
	// +optional
	Ref TargetRef `json:"ref,omitempty"`
	// TotalHosts specifies total number of hosts for this target that will be backed up for a BackupSession
	// +optional
	TotalHosts *int32 `json:"totalHosts,omitempty"`
	// Phase indicates backup phase of this target
	// +optional
	Phase TargetPhase `json:"phase,omitempty"`
	// Stats shows statistics of individual hosts for this backup session
	// +optional
	Stats []HostBackupStats `json:"stats,omitempty"`
	// PreBackupActions specifies a list of actions that the backup process should execute before taking backup
	// +optional
	PreBackupActions []string `json:"preBackupActions,omitempty"`
	// PostBackupActions specifies a list of actions that the backup process should execute after taking backup
	// +optional
	PostBackupActions []string `json:"postBackupActions,omitempty"`
	// Conditions shows condition of different operations/steps of the backup process for this target
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
}

func (*BackupTargetStatus) DeepCopy

func (in *BackupTargetStatus) DeepCopy() *BackupTargetStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupTargetStatus.

func (*BackupTargetStatus) DeepCopyInto

func (in *BackupTargetStatus) DeepCopyInto(out *BackupTargetStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EmptyDirSettings

type EmptyDirSettings struct {
	Medium    core.StorageMedium `json:"medium,omitempty"`
	SizeLimit *resource.Quantity `json:"sizeLimit,omitempty"`
	// More info: https://github.com/restic/restic/blob/master/doc/manual_rest.rst#caching
	DisableCaching bool `json:"disableCaching,omitempty"`
}

func (*EmptyDirSettings) DeepCopy

func (in *EmptyDirSettings) DeepCopy() *EmptyDirSettings

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmptyDirSettings.

func (*EmptyDirSettings) DeepCopyInto

func (in *EmptyDirSettings) DeepCopyInto(out *EmptyDirSettings)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExecutionOrder

type ExecutionOrder string
const (
	Parallel   ExecutionOrder = "Parallel"
	Sequential ExecutionOrder = "Sequential"
)

type FileStats

type FileStats struct {
	// TotalFiles shows total number of files that has been backed up
	TotalFiles *int64 `json:"totalFiles,omitempty"`
	// NewFiles shows total number of new files that has been created since last backup
	NewFiles *int64 `json:"newFiles,omitempty"`
	// ModifiedFiles shows total number of files that has been modified since last backup
	ModifiedFiles *int64 `json:"modifiedFiles,omitempty"`
	// UnmodifiedFiles shows total number of files that has not been changed since last backup
	UnmodifiedFiles *int64 `json:"unmodifiedFiles,omitempty"`
}

func (*FileStats) DeepCopy

func (in *FileStats) DeepCopy() *FileStats

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileStats.

func (*FileStats) DeepCopyInto

func (in *FileStats) DeepCopyInto(out *FileStats)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Function

type Function struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              FunctionSpec `json:"spec,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:path=functions,singular=function,scope=Cluster,shortName=fn,categories={stash,appscode} +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (Function) CustomResourceDefinition

func (_ Function) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*Function) DeepCopy

func (in *Function) DeepCopy() *Function

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Function.

func (*Function) DeepCopyInto

func (in *Function) DeepCopyInto(out *Function)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Function) DeepCopyObject

func (in *Function) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FunctionList

type FunctionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Function `json:"items,omitempty"`
}

func (*FunctionList) DeepCopy

func (in *FunctionList) DeepCopy() *FunctionList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FunctionList.

func (*FunctionList) DeepCopyInto

func (in *FunctionList) DeepCopyInto(out *FunctionList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FunctionList) DeepCopyObject

func (in *FunctionList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FunctionRef

type FunctionRef struct {
	// Name indicates the name of Function crd
	Name string `json:"name,omitempty"`
	// Inputs specifies the inputs of respective Function
	// +optional
	Params []Param `json:"params,omitempty"`
}

func (*FunctionRef) DeepCopy

func (in *FunctionRef) DeepCopy() *FunctionRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FunctionRef.

func (*FunctionRef) DeepCopyInto

func (in *FunctionRef) DeepCopyInto(out *FunctionRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FunctionSpec

type FunctionSpec struct {
	// Docker image name.
	// More info: https://kubernetes.io/docs/concepts/containers/images
	// This field is optional to allow higher level config management to default or override
	// container images in workload controllers like Deployments and StatefulSets.
	// +optional
	Image string `json:"image,omitempty"`
	// Entrypoint array. Not executed within a shell.
	// The docker image's ENTRYPOINT is used if this is not provided.
	// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
	// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
	// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
	// regardless of whether the variable exists or not.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	// +optional
	Command []string `json:"command,omitempty"`
	// Arguments to the entrypoint.
	// The docker image's CMD is used if this is not provided.
	// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
	// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
	// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
	// regardless of whether the variable exists or not.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	// +optional
	Args []string `json:"args,omitempty"`
	// Container's working directory.
	// If not specified, the container runtime's default will be used, which
	// might be configured in the container image.
	// Cannot be updated.
	// +optional
	WorkingDir string `json:"workingDir,omitempty"`
	// List of ports to expose from the container. Exposing a port here gives
	// the system additional information about the network connections a
	// container uses, but is primarily informational. Not specifying a port here
	// DOES NOT prevent that port from being exposed. Any port which is
	// listening on the default "0.0.0.0" address inside a container will be
	// accessible from the network.
	// Cannot be updated.
	// +optional
	// +patchMergeKey=containerPort
	// +patchStrategy=merge
	Ports []core.ContainerPort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"containerPort"`
	// Pod volumes to mount into the container's filesystem.
	// Cannot be updated.
	// +optional
	// +patchMergeKey=mountPath
	// +patchStrategy=merge
	VolumeMounts []core.VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath"`
	// volumeDevices is the list of block devices to be used by the container.
	// This is an alpha feature and may change in the future.
	// +patchMergeKey=devicePath
	// +patchStrategy=merge
	// +optional
	VolumeDevices []core.VolumeDevice `json:"volumeDevices,omitempty" patchStrategy:"merge" patchMergeKey:"devicePath"`
	// RuntimeSettings allow to specify Resources, LivenessProbe, ReadinessProbe, Lifecycle, SecurityContext etc.
	// +optional
	RuntimeSettings *ofst.ContainerRuntimeSettings `json:"runtimeSettings,omitempty"`
	// Name of PodSecurityPolicy(PSP) required by this function
	// +optional
	PodSecurityPolicyName string `json:"podSecurityPolicyName,omitempty"`
}

func (*FunctionSpec) DeepCopy

func (in *FunctionSpec) DeepCopy() *FunctionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FunctionSpec.

func (*FunctionSpec) DeepCopyInto

func (in *FunctionSpec) DeepCopyInto(out *FunctionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HookExecutionPolicy added in v0.22.0

type HookExecutionPolicy string
const (
	ExecuteAlways    HookExecutionPolicy = "Always"
	ExecuteOnFailure HookExecutionPolicy = "OnFailure"
	ExecuteOnSuccess HookExecutionPolicy = "OnSuccess"
)

type HostBackupPhase

type HostBackupPhase string

+kubebuilder:validation:Enum=Succeeded;Failed

const (
	HostBackupSucceeded HostBackupPhase = "Succeeded"
	HostBackupFailed    HostBackupPhase = "Failed"
)

type HostBackupStats

type HostBackupStats struct {
	// Hostname indicate name of the host that has been backed up
	// +optional
	Hostname string `json:"hostname,omitempty"`
	// Phase indicates backup phase of this host
	// +optional
	Phase HostBackupPhase `json:"phase,omitempty"`
	// Snapshots specifies the stats of individual snapshots that has been taken for this host in current backup session
	// +optional
	Snapshots []SnapshotStats `json:"snapshots,omitempty"`
	// Duration indicates total time taken to complete backup for this hosts
	// +optional
	Duration string `json:"duration,omitempty"`
	// Error indicates string value of error in case of backup failure
	// +optional
	Error string `json:"error,omitempty"`
}

func (*HostBackupStats) DeepCopy

func (in *HostBackupStats) DeepCopy() *HostBackupStats

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostBackupStats.

func (*HostBackupStats) DeepCopyInto

func (in *HostBackupStats) DeepCopyInto(out *HostBackupStats)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HostRestorePhase

type HostRestorePhase string

+kubebuilder:validation:Enum=Succeeded;Failed;Running;Unknown

const (
	HostRestoreSucceeded HostRestorePhase = "Succeeded"
	HostRestoreFailed    HostRestorePhase = "Failed"
	HostRestoreRunning   HostRestorePhase = "Running"
	HostRestoreUnknown   HostRestorePhase = "Unknown"
)

type HostRestoreStats

type HostRestoreStats struct {
	// Hostname indicate name of the host that has been restored
	// +optional
	Hostname string `json:"hostname,omitempty"`
	// Phase indicates restore phase of this host
	// +optional
	Phase HostRestorePhase `json:"phase,omitempty"`
	// Duration indicates total time taken to complete restore for this hosts
	// +optional
	Duration string `json:"duration,omitempty"`
	// Error indicates string value of error in case of restore failure
	// +optional
	Error string `json:"error,omitempty"`
}

func (*HostRestoreStats) DeepCopy

func (in *HostRestoreStats) DeepCopy() *HostRestoreStats

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostRestoreStats.

func (*HostRestoreStats) DeepCopyInto

func (in *HostRestoreStats) DeepCopyInto(out *HostRestoreStats)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MemberConditions

type MemberConditions struct {
	// Target is the reference to the respective target whose condition is shown here.
	Target TargetRef `json:"target"`
	// Conditions shows current backup setup condition of this member.
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
}

func (*MemberConditions) DeepCopy

func (in *MemberConditions) DeepCopy() *MemberConditions

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberConditions.

func (*MemberConditions) DeepCopyInto

func (in *MemberConditions) DeepCopyInto(out *MemberConditions)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Param

type Param struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Param declares a value to use for the Param called Name.

func (*Param) DeepCopy

func (in *Param) DeepCopy() *Param

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Param.

func (*Param) DeepCopyInto

func (in *Param) DeepCopyInto(out *Param)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PostBackupHook added in v0.22.0

type PostBackupHook struct {
	*prober.Handler `json:",inline"`
	// ExecutionPolicy specifies when to execute a hook.
	// Supported values are "Always", "OnFailure", "OnSuccess".
	// Default value: "Always".
	// +optional
	// +kubebuilder:default=Always
	// +kubebuilder:validation:Enum=Always;OnFailure;OnSuccess
	ExecutionPolicy HookExecutionPolicy `json:"executionPolicy,omitempty"`
}

func (*PostBackupHook) DeepCopy added in v0.22.0

func (in *PostBackupHook) DeepCopy() *PostBackupHook

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostBackupHook.

func (*PostBackupHook) DeepCopyInto added in v0.22.0

func (in *PostBackupHook) DeepCopyInto(out *PostBackupHook)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PostRestoreHook added in v0.22.0

type PostRestoreHook struct {
	*prober.Handler `json:",inline"`
	// ExecutionPolicy specifies when to execute a hook.
	// Supported values are "Always", "OnFailure", "OnSuccess".
	// Default value: "Always".
	// +optional
	// +kubebuilder:default=Always
	// +kubebuilder:validation:Enum=Always;OnFailure;OnSuccess
	ExecutionPolicy HookExecutionPolicy `json:"executionPolicy,omitempty"`
}

func (*PostRestoreHook) DeepCopy added in v0.22.0

func (in *PostRestoreHook) DeepCopy() *PostRestoreHook

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostRestoreHook.

func (*PostRestoreHook) DeepCopyInto added in v0.22.0

func (in *PostRestoreHook) DeepCopyInto(out *PostRestoreHook)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreBatch

type RestoreBatch struct {
	metav1.TypeMeta   `json:",inline,omitempty"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              RestoreBatchSpec   `json:"spec,omitempty"`
	Status            RestoreBatchStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:path=restorebatches,singular=restorebatch,categories={stash,appscode,all} +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Repository",type="string",JSONPath=".spec.repository.name" +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +kubebuilder:printcolumn:name="Duration",type="string",JSONPath=".status.sessionDuration" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (RestoreBatch) CustomResourceDefinition

func (_ RestoreBatch) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*RestoreBatch) DeepCopy

func (in *RestoreBatch) DeepCopy() *RestoreBatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreBatch.

func (*RestoreBatch) DeepCopyInto

func (in *RestoreBatch) DeepCopyInto(out *RestoreBatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RestoreBatch) DeepCopyObject

func (in *RestoreBatch) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (RestoreBatch) GetSpecHash

func (b RestoreBatch) GetSpecHash() string

func (RestoreBatch) OffshootLabels

func (b RestoreBatch) OffshootLabels() map[string]string

OffshootLabels return labels consist of the labels provided by user to RestoreBatch crd and stash specific generic labels. It overwrites the the user provided labels if it matched with stash specific generic labels.

type RestoreBatchList

type RestoreBatchList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []RestoreBatch `json:"items,omitempty"`
}

func (*RestoreBatchList) DeepCopy

func (in *RestoreBatchList) DeepCopy() *RestoreBatchList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreBatchList.

func (*RestoreBatchList) DeepCopyInto

func (in *RestoreBatchList) DeepCopyInto(out *RestoreBatchList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RestoreBatchList) DeepCopyObject

func (in *RestoreBatchList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RestoreBatchSpec

type RestoreBatchSpec struct {
	// Driver indicates the name of the agent to use to restore the target.
	// Supported values are "Restic", "VolumeSnapshotter".
	// Default value is "Restic".
	// +optional
	// +kubebuilder:default=Restic
	Driver Snapshotter `json:"driver,omitempty"`
	// Repository refer to the Repository crd that holds backend information
	// +optional
	Repository kmapi.ObjectReference `json:"repository,omitempty"`
	// Members is a list of restore targets and their configuration that are part of this batch
	// +optional
	Members []RestoreTargetSpec `json:"members,omitempty"`
	// ExecutionOrder indicate whether to restore the members in the sequential order as they appear in the members list.
	// The default value is "Parallel" which means the members will be restored in parallel.
	// +kubebuilder:default=Parallel
	// +optional
	ExecutionOrder ExecutionOrder `json:"executionOrder,omitempty"`
	// Hooks specifies the actions that Stash should take before or after restore.
	// Cannot be updated.
	// +optional
	Hooks *RestoreHooks `json:"hooks,omitempty"`
	// TimeOut specifies the maximum duration of restore. RestoreBatch will be considered Failed
	// if restore does not complete within this time limit. By default, Stash don't set any timeout for restore.
	// +optional
	TimeOut *metav1.Duration `json:"timeOut,omitempty"`
}

func (*RestoreBatchSpec) DeepCopy

func (in *RestoreBatchSpec) DeepCopy() *RestoreBatchSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreBatchSpec.

func (*RestoreBatchSpec) DeepCopyInto

func (in *RestoreBatchSpec) DeepCopyInto(out *RestoreBatchSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreBatchStatus

type RestoreBatchStatus struct {
	// Phase indicates the overall phase of the restore process for this RestoreBatch. Phase will be "Succeeded" only if
	// phase of all members are "Succeeded". If the restore process fail for any of the members, Phase will be "Failed".
	// +optional
	Phase RestorePhase `json:"phase,omitempty"`
	// SessionDuration specify total time taken to complete restore of all the members.
	// +optional
	SessionDuration string `json:"sessionDuration,omitempty"`
	// Conditions shows the condition of different steps for the RestoreBatch.
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
	// Members shows the restore status for the members of the RestoreBatch.
	// +optional
	Members []RestoreMemberStatus `json:"members,omitempty"`
	// SessionDeadline specifies the deadline of restore process. RestoreBatch will be
	// considered Failed if restore does not complete within this deadline
	// +optional
	SessionDeadline *metav1.Time `json:"sessionDeadline,omitempty"`
}

func (*RestoreBatchStatus) DeepCopy

func (in *RestoreBatchStatus) DeepCopy() *RestoreBatchStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreBatchStatus.

func (*RestoreBatchStatus) DeepCopyInto

func (in *RestoreBatchStatus) DeepCopyInto(out *RestoreBatchStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreHooks

type RestoreHooks struct {
	// PreRestore is called immediately before a restore session is initiated.
	// +optional
	PreRestore *prober.Handler `json:"preRestore,omitempty"`

	// PostRestore is called according to executionPolicy after a restore session is complete.
	// +optional
	PostRestore *PostRestoreHook `json:"postRestore,omitempty"`
}

Hooks describes actions that Stash should take in response to restore sessions. For the PostRestore and PreRestore handlers, restore process blocks until the action is complete, unless the container process fails, in which case the handler is aborted.

func (*RestoreHooks) DeepCopy

func (in *RestoreHooks) DeepCopy() *RestoreHooks

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreHooks.

func (*RestoreHooks) DeepCopyInto

func (in *RestoreHooks) DeepCopyInto(out *RestoreHooks)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreMemberStatus

type RestoreMemberStatus struct {
	// Ref is the reference to the respective target whose status is shown here.
	Ref TargetRef `json:"ref"`
	// Conditions shows the condition of different steps to restore this member.
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
	// TotalHosts specifies total number of hosts that will be restored for this member.
	// +optional
	TotalHosts *int32 `json:"totalHosts,omitempty"`
	// Phase indicates restore phase of this member
	// +optional
	Phase RestoreTargetPhase `json:"phase,omitempty"`
	// Stats shows restore statistics of individual hosts for this member
	// +optional
	Stats []HostRestoreStats `json:"stats,omitempty"`
}

func (*RestoreMemberStatus) DeepCopy

func (in *RestoreMemberStatus) DeepCopy() *RestoreMemberStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreMemberStatus.

func (*RestoreMemberStatus) DeepCopyInto

func (in *RestoreMemberStatus) DeepCopyInto(out *RestoreMemberStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestorePhase

type RestorePhase string

+kubebuilder:validation:Enum=Pending;Running;Succeeded;Failed;Unknown;Invalid

const (
	RestorePending      RestorePhase = "Pending"
	RestoreRunning      RestorePhase = "Running"
	RestoreSucceeded    RestorePhase = "Succeeded"
	RestoreFailed       RestorePhase = "Failed"
	RestorePhaseUnknown RestorePhase = "Unknown"
	RestorePhaseInvalid RestorePhase = "Invalid"
)

type RestoreSession

type RestoreSession struct {
	metav1.TypeMeta   `json:",inline,omitempty"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              RestoreSessionSpec   `json:"spec,omitempty"`
	Status            RestoreSessionStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:path=restoresessions,singular=restoresession,shortName=restore,categories={stash,appscode,all} +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Repository",type="string",JSONPath=".spec.repository.name" +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +kubebuilder:printcolumn:name="Duration",type="string",JSONPath=".status.sessionDuration" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (RestoreSession) CustomResourceDefinition

func (_ RestoreSession) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*RestoreSession) DeepCopy

func (in *RestoreSession) DeepCopy() *RestoreSession

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreSession.

func (*RestoreSession) DeepCopyInto

func (in *RestoreSession) DeepCopyInto(out *RestoreSession)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RestoreSession) DeepCopyObject

func (in *RestoreSession) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (RestoreSession) GetSpecHash

func (r RestoreSession) GetSpecHash() string

func (RestoreSession) IsValid

func (r RestoreSession) IsValid() error

TODO: complete

func (*RestoreSession) Migrate

func (r *RestoreSession) Migrate()

Migrate moved deprecated fields into the appropriate fields

func (RestoreSession) OffshootLabels

func (r RestoreSession) OffshootLabels() map[string]string

OffshootLabels return labels consist of the labels provided by user to BackupConfiguration crd and stash specific generic labels. It overwrites the the user provided labels if it matched with stash specific generic labels.

type RestoreSessionList

type RestoreSessionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []RestoreSession `json:"items,omitempty"`
}

func (*RestoreSessionList) DeepCopy

func (in *RestoreSessionList) DeepCopy() *RestoreSessionList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreSessionList.

func (*RestoreSessionList) DeepCopyInto

func (in *RestoreSessionList) DeepCopyInto(out *RestoreSessionList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RestoreSessionList) DeepCopyObject

func (in *RestoreSessionList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RestoreSessionSpec

type RestoreSessionSpec struct {
	RestoreTargetSpec `json:",inline,omitempty"`
	// Driver indicates the name of the agent to use to restore the target.
	// Supported values are "Restic", "VolumeSnapshotter".
	// Default value is "Restic".
	// +optional
	// +kubebuilder:default=Restic
	Driver Snapshotter `json:"driver,omitempty"`
	// Repository refer to the Repository crd that hold backend information
	// +optional
	Repository kmapi.ObjectReference `json:"repository,omitempty"`
	// Rules specifies different restore options for different hosts
	// +optional
	// Deprecated. Use rules section inside `target`.
	Rules []Rule `json:"rules,omitempty"`
	// TimeOut specifies the maximum duration of restore. RestoreSession will be considered Failed
	// if restore does not complete within this time limit. By default, Stash don't set any timeout for restore.
	// +optional
	TimeOut *metav1.Duration `json:"timeOut,omitempty"`
}

func (*RestoreSessionSpec) DeepCopy

func (in *RestoreSessionSpec) DeepCopy() *RestoreSessionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreSessionSpec.

func (*RestoreSessionSpec) DeepCopyInto

func (in *RestoreSessionSpec) DeepCopyInto(out *RestoreSessionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreSessionStatus

type RestoreSessionStatus struct {
	// Phase indicates the overall phase of the restore process for this RestoreSession. Phase will be "Succeeded" only if
	// phase of all hosts are "Succeeded". If any of the host fail to complete restore, Phase will be "Failed".
	// +optional
	Phase RestorePhase `json:"phase,omitempty"`
	// TotalHosts specifies total number of hosts that will be restored for this RestoreSession
	// +optional
	TotalHosts *int32 `json:"totalHosts,omitempty"`
	// SessionDuration specify total time taken to complete current restore session (sum of restore duration of all hosts)
	// +optional
	SessionDuration string `json:"sessionDuration,omitempty"`
	// Stats shows statistics of individual hosts for this restore session
	// +optional
	Stats []HostRestoreStats `json:"stats,omitempty"`
	// Conditions shows current restore condition of the RestoreSession.
	// +optional
	Conditions []kmapi.Condition `json:"conditions,omitempty"`
	// SessionDeadline specifies the deadline of restore process. RestoreSession will be
	// considered Failed if restore does not complete within this deadline
	// +optional
	SessionDeadline *metav1.Time `json:"sessionDeadline,omitempty"`
}

func (*RestoreSessionStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreSessionStatus.

func (*RestoreSessionStatus) DeepCopyInto

func (in *RestoreSessionStatus) DeepCopyInto(out *RestoreSessionStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreTarget

type RestoreTarget struct {
	// Alias represents the identifier of the backed up data in the repository.
	// This will be used as `sourceHost` and `targetHosts` or will be used to generate them.
	// +optional
	Alias string `json:"alias,omitempty"`
	// Ref refers to the restore,target
	Ref TargetRef `json:"ref,omitempty"`
	// VolumeMounts specifies the volumes to mount inside stash sidecar/init container
	// Specify the volumes that contains the target directories
	// +optional
	VolumeMounts []core.VolumeMount `json:"volumeMounts,omitempty"`
	// replicas is the desired number of replicas of the given Template.
	// These are replicas in the sense that they are instantiations of the
	// same Template, but individual replicas also have a consistent identity.
	// If unspecified, defaults to 1.
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`
	// volumeClaimTemplates is a list of claims that will be created while restore from VolumeSnapshot
	// +optional
	VolumeClaimTemplates []ofst.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
	// Rules specifies different restore options for different hosts
	// +optional
	Rules []Rule `json:"rules,omitempty"`
	// Args specifies a list of arguments to pass to the restore driver.
	// +optional
	Args []string `json:"args,omitempty"`
}

func (*RestoreTarget) DeepCopy

func (in *RestoreTarget) DeepCopy() *RestoreTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreTarget.

func (*RestoreTarget) DeepCopyInto

func (in *RestoreTarget) DeepCopyInto(out *RestoreTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreTargetPhase

type RestoreTargetPhase string

+kubebuilder:validation:Enum=Pending;Succeeded;Running;Failed

const (
	TargetRestorePending      RestoreTargetPhase = "Pending"
	TargetRestoreRunning      RestoreTargetPhase = "Running"
	TargetRestoreSucceeded    RestoreTargetPhase = "Succeeded"
	TargetRestoreFailed       RestoreTargetPhase = "Failed"
	TargetRestorePhaseUnknown RestoreTargetPhase = "Unknown"
)

type RestoreTargetSpec

type RestoreTargetSpec struct {
	// Task specify the Task crd that specifies the steps for recovery process
	// +optional
	Task TaskRef `json:"task,omitempty"`
	// Target indicates the target where the recovered data will be stored
	// +optional
	Target *RestoreTarget `json:"target,omitempty"`
	// RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc.
	// +optional
	RuntimeSettings ofst.RuntimeSettings `json:"runtimeSettings,omitempty"`
	// Temp directory configuration for functions/sidecar
	// An `EmptyDir` will always be mounted at /tmp with this settings
	// +optional
	TempDir EmptyDirSettings `json:"tempDir,omitempty"`
	// InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily
	// before uploading to backend or inserting into target. It is only usable for job model.
	// Don't specify it in sidecar model.
	// +optional
	InterimVolumeTemplate *ofst.PersistentVolumeClaim `json:"interimVolumeTemplate,omitempty"`
	// Actions that Stash should take in response to restore sessions.
	// +optional
	Hooks *RestoreHooks `json:"hooks,omitempty"`
}

func (*RestoreTargetSpec) DeepCopy

func (in *RestoreTargetSpec) DeepCopy() *RestoreTargetSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreTargetSpec.

func (*RestoreTargetSpec) DeepCopyInto

func (in *RestoreTargetSpec) DeepCopyInto(out *RestoreTargetSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RetryConfig added in v0.23.0

type RetryConfig struct {
	// MaxRetry specifies the maximum number of attempts Stash should retry. Default value: 1
	// +kubebuilder:default=1
	MaxRetry int32 `json:"maxRetry,omitempty"`

	// The amount of time to wait before next retry. If you don't specify this field, Stash will retry immediately.
	// Format: 30s, 2m, 1h etc.
	// +optional
	Delay metav1.Duration `json:"delay,omitempty"`
}

func (*RetryConfig) DeepCopy added in v0.23.0

func (in *RetryConfig) DeepCopy() *RetryConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetryConfig.

func (*RetryConfig) DeepCopyInto added in v0.23.0

func (in *RetryConfig) DeepCopyInto(out *RetryConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Rule

type Rule struct {
	// Subjects specifies the list of hosts that are subject to this rule
	// +optional
	TargetHosts []string `json:"targetHosts,omitempty"`
	// SourceHost specifies the name of the host whose backed up state we are trying to restore
	// By default, it will indicate the workload itself
	// +optional
	SourceHost string `json:"sourceHost,omitempty"`
	// Snapshots specifies the list of snapshots that will be restored for the host under this rule.
	// Don't specify if you have specified paths field.
	// +optional
	Snapshots []string `json:"snapshots,omitempty"`
	// Paths specifies the paths to be restored for the hosts under this rule.
	// Don't specify if you have specified snapshots field.
	// +optional
	Paths []string `json:"paths,omitempty"`
	// Exclude specifies a list of patterns for the files to ignore during restore.
	// Stash will only restore the files that does not match those patterns.
	// Supported only for "Restic" driver
	// +optional
	Exclude []string `json:"exclude,omitempty"`
	// Include specifies a list of patterns for the files to restore.
	// Stash will only restore the files that match those patterns.
	// Supported only for "Restic" driver
	// +optional
	Include []string `json:"include,omitempty"`
}

func (*Rule) DeepCopy

func (in *Rule) DeepCopy() *Rule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.

func (*Rule) DeepCopyInto

func (in *Rule) DeepCopyInto(out *Rule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SnapshotStats

type SnapshotStats struct {
	// Name indicates the name of the backup snapshot created for this host
	Name string `json:"name,omitempty"`
	// Path indicates the directory that has been backed up in this snapshot
	Path string `json:"path,omitempty"`
	// TotalSize indicates the size of data to backup in target directory
	TotalSize string `json:"totalSize,omitempty"`
	// Uploaded indicates size of data uploaded to backend for this snapshot
	Uploaded string `json:"uploaded,omitempty"`
	// ProcessingTime indicates time taken to process the target data
	ProcessingTime string `json:"processingTime,omitempty"`
	// FileStats shows statistics of files of this snapshot
	FileStats FileStats `json:"fileStats,omitempty"`
}

func (*SnapshotStats) DeepCopy

func (in *SnapshotStats) DeepCopy() *SnapshotStats

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotStats.

func (*SnapshotStats) DeepCopyInto

func (in *SnapshotStats) DeepCopyInto(out *SnapshotStats)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Snapshotter

type Snapshotter string

+kubebuilder:validation:Enum=Restic;VolumeSnapshotter

const (
	ResticSnapshotter Snapshotter = "Restic"
	VolumeSnapshotter Snapshotter = "VolumeSnapshotter"
)

type Summary added in v0.19.0

type Summary struct {
	// Name of the respective BackupSession/RestoreSession/RestoreBatch
	Name string `json:"name,omitempty"`
	// Namespace of the respective invoker
	Namespace string `json:"namespace,omitempty"`

	// Invoker specifies the information about the invoker which resulted this session
	Invoker core.TypedLocalObjectReference `json:"invoker,omitempty"`
	// Target specifies the target information that has been backed up /restored in this session
	Target TargetRef `json:"target,omitempty"`
	// Status specifies the backup/restore status for the respective target
	Status TargetStatus `json:"status,omitempty"`
}

Summary summarizes backup/restore session information for a target

func (*Summary) DeepCopy added in v0.19.0

func (in *Summary) DeepCopy() *Summary

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Summary.

func (*Summary) DeepCopyInto added in v0.19.0

func (in *Summary) DeepCopyInto(out *Summary)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TargetPhase

type TargetPhase string

+kubebuilder:validation:Enum=Pending;Succeeded;Running;Failed

const (
	TargetBackupPending   TargetPhase = "Pending"
	TargetBackupSucceeded TargetPhase = "Succeeded"
	TargetBackupRunning   TargetPhase = "Running"
	TargetBackupFailed    TargetPhase = "Failed"
)

type TargetRef

type TargetRef struct {
	APIVersion string `json:"apiVersion,omitempty"`
	Kind       string `json:"kind,omitempty"`
	Name       string `json:"name,omitempty"`
	// +optional
	Namespace string `json:"namespace,omitempty"`
}

func EmptyTargetRef added in v0.20.0

func EmptyTargetRef() TargetRef

func (*TargetRef) DeepCopy

func (in *TargetRef) DeepCopy() *TargetRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetRef.

func (*TargetRef) DeepCopyInto

func (in *TargetRef) DeepCopyInto(out *TargetRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (TargetRef) IsWorkload

func (t TargetRef) IsWorkload() bool

TODO: complete

type TargetStatus added in v0.19.0

type TargetStatus struct {
	// Phase represent the backup/restore phase of the target
	Phase string `json:"phase,omitempty"`
	// Duration represent the amount of time it took to complete the backup for this target.
	Duration string `json:"duration,omitempty"`
	// Error specifies the respective error message in case of backup/restore failure
	Error string `json:"error,omitempty"`
}

func (*TargetStatus) DeepCopy added in v0.19.0

func (in *TargetStatus) DeepCopy() *TargetStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetStatus.

func (*TargetStatus) DeepCopyInto added in v0.19.0

func (in *TargetStatus) DeepCopyInto(out *TargetStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Task

type Task struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              TaskSpec `json:"spec,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:path=tasks,singular=task,scope=Cluster,shortName=task,categories={stash,appscode} +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (Task) CustomResourceDefinition

func (_ Task) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*Task) DeepCopy

func (in *Task) DeepCopy() *Task

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Task.

func (*Task) DeepCopyInto

func (in *Task) DeepCopyInto(out *Task)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Task) DeepCopyObject

func (in *Task) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TaskList

type TaskList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Task `json:"items,omitempty"`
}

func (*TaskList) DeepCopy

func (in *TaskList) DeepCopy() *TaskList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskList.

func (*TaskList) DeepCopyInto

func (in *TaskList) DeepCopyInto(out *TaskList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TaskList) DeepCopyObject

func (in *TaskList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TaskRef

type TaskRef struct {
	// Name specifies the name of the Task to use for backup/restore purpose. If your database has been deployed with KubeDB,
	// then keep this field empty. Stash will read the Task info from the respective AppBinding.
	// +optional
	Name string `json:"name,omitempty"`
	// Params specifies a list of parameter to pass to the Task. Stash will use this parameters to resolve the task.
	// +optional
	Params []Param `json:"params,omitempty"`
}

func (*TaskRef) DeepCopy

func (in *TaskRef) DeepCopy() *TaskRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskRef.

func (*TaskRef) DeepCopyInto

func (in *TaskRef) DeepCopyInto(out *TaskRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TaskSpec

type TaskSpec struct {
	Steps []FunctionRef `json:"steps,omitempty"`
	// List of volumes that can be mounted by containers belonging to the pod created for this task.
	// +optional
	Volumes []core.Volume `json:"volumes,omitempty"`
}

func (*TaskSpec) DeepCopy

func (in *TaskSpec) DeepCopy() *TaskSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskSpec.

func (*TaskSpec) DeepCopyInto

func (in *TaskSpec) DeepCopyInto(out *TaskSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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