Documentation ¶
Index ¶
- Variables
- func AttachLocalBackend(podSpec core.PodSpec, localSpec store.LocalSpec) core.PodSpec
- func AttachPVC(podSpec core.PodSpec, volumes []core.Volume, volumeMounts []core.VolumeMount) core.PodSpec
- func BackupBatchEqual(old, new *v1beta1.BackupBatch) bool
- func BackupConfigurationEqual(old, new *v1beta1_api.BackupConfiguration) bool
- func BackupModel(kind string) string
- func BackupOptionsForBackupTarget(backupTarget *api.BackupTarget, retentionPolicy api_v1alpha1.RetentionPolicy, ...) restic.BackupOptions
- func BackupPending(phase v1beta1_api.BackupSessionPhase) bool
- func CreateBatchPVC(kubeClient kubernetes.Interface, namespace string, ...) error
- func DeleteAllConfigMapLocks(k8sClient kubernetes.Interface, namespace, name, kind string) error
- func DeleteBackupConfigMapLock(k8sClient kubernetes.Interface, namespace string, r v1beta1_api.TargetRef) error
- func DeleteConfigmapLock(k8sClient kubernetes.Interface, namespace string, ...) error
- func DeleteRestoreConfigMapLock(k8sClient kubernetes.Interface, namespace string, r v1beta1_api.TargetRef) error
- func EnsureDefaultFunctions(stashClient cs.Interface, registry, imageTag string) error
- func EnsureDefaultTasks(stashClient cs.Interface) error
- func EnsureVolumeDeleted(volumes []core.Volume, name string) []core.Volume
- func ExecuteHook(config *rest.Config, hook interface{}, hookType, podName, namespace string) error
- func FindBackupBatch(lister v1beta1_listers.BackupBatchLister, w *wapi.Workload) (*v1beta1.BackupBatch, error)
- func FindBackupConfigForRepository(stashClient cs.Interface, repository v1alpha1.Repository) (*v1beta1_api.BackupConfiguration, error)
- func FindBackupConfiguration(lister v1beta1_listers.BackupConfigurationLister, w *wapi.Workload) (*v1beta1_api.BackupConfiguration, error)
- func FindRestic(lister stash_listers.ResticLister, obj metav1.ObjectMeta) (*api.Restic, error)
- func FindRestoreSession(lister v1beta1_listers.RestoreSessionLister, w *wapi.Workload) (*v1beta1_api.RestoreSession, error)
- func FixBackendPrefix(backend *store.Backend, autoPrefix string) *store.Backend
- func GetAppliedBackupBatch(m map[string]string) (*v1beta1.BackupBatch, error)
- func GetAppliedBackupConfiguration(m map[string]string) (*v1beta1_api.BackupConfiguration, error)
- func GetAppliedRestic(m map[string]string) (*api.Restic, error)
- func GetAppliedRestoreSession(m map[string]string) (*v1beta1_api.RestoreSession, error)
- func GetBackupConfigmapLockName(r v1beta1_api.TargetRef) string
- func GetBucketAndPrefix(backend *store.Backend) (string, string, error)
- func GetConfigmapLockName(workload api.LocalTypedReference) string
- func GetHostName(target interface{}) (string, error)
- func GetRepoNameAndSnapshotID(snapshotName string) (repoName, snapshotId string, err error)
- func GetRestoreConfigmapLockName(r v1beta1_api.TargetRef) string
- func GetRestoreHostName(stashClient cs.Interface, restoreSessionName, namespace string) (string, error)
- func GetString(m map[string]string, key string) string
- func GetWorkloadReference(w *wapi.Workload) (*core.ObjectReference, error)
- func HasOldReplicaAnnotation(k8sClient *kubernetes.Clientset, namespace string, ...) bool
- func HasStashContainer(w *wapi.Workload) bool
- func HasStashInitContainer(containers []core.Container) bool
- func HasStashSidecar(containers []core.Container) bool
- func HookExecutorContainer(name string, shiblings []core.Container, ...) core.Container
- func IONiceSettingsFromEnv() (*v1.IONiceSettings, error)
- func IsBackupTarget(target *v1beta1_api.BackupTarget, w *wapi.Workload) bool
- func IsRestoreTarget(target *v1beta1_api.RestoreTarget, w *wapi.Workload) bool
- func MergeLocalVolume(volumes []core.Volume, backend *store.Backend) []core.Volume
- func NewBackupSidecarContainer(invoker apis.Invoker, targetInfo apis.TargetInfo, backend *store.Backend, ...) core.Container
- func NewCheckJob(restic *api_v1alpha1.Restic, hostName, smartPrefix string, image docker.Docker) *batch.Job
- func NewInitContainer(r *v1alpha1_api.Restic, workload v1alpha1_api.LocalTypedReference, ...) core.Container
- func NewPVCRestorerJob(rs *api_v1beta1.RestoreSession, repository *api_v1alpha1.Repository, ...) (*core.PodTemplateSpec, error)
- func NewRecoveryJob(stashClient cs.Interface, recovery *api_v1alpha1.Recovery, image docker.Docker) (*batch.Job, error)
- func NewRestoreInitContainer(rs *v1beta1_api.RestoreSession, repository *v1alpha1_api.Repository, ...) core.Container
- func NewSidecarContainer(r *api.Restic, workload api.LocalTypedReference, image docker.Docker) core.Container
- func NewVolumeRestorerJob(rs *api_v1beta1.RestoreSession, image docker.Docker) (*core.PodTemplateSpec, error)
- func NewVolumeSnapshotterJob(bs *api_v1beta1.BackupSession, backupTarget *api_v1beta1.BackupTarget, ...) (*core.PodTemplateSpec, error)
- func NiceSettingsFromEnv() (*v1.NiceSettings, error)
- func PVCListToVolumes(pvcList []core.PersistentVolumeClaim, ordinal int32) []core.Volume
- func ParseInt32P(v string) (*int32, error)
- func PushgatewayURL() string
- func RecoveryEqual(old, new *api.Recovery) bool
- func ResourceKindShortForm(kind string) string
- func ResticEqual(old, new *api.Restic) bool
- func RestoreOptionForRestoreSession(restoreSession api.RestoreSession, extraOpt ExtraOptions) restic.RestoreOptions
- func RestoreOptionsForHost(hostname string, rules []api.Rule) restic.RestoreOptions
- func RestoreSessionEqual(old, new *v1beta1_api.RestoreSession) bool
- func SetupOptionsForRepository(repository api_v1alpha1.Repository, extraOpt ExtraOptions) (restic.SetupOptions, error)
- func UpsertDefaultPodSecurityContext(currentSC *core.PodSecurityContext) *core.PodSecurityContext
- func UpsertDownwardVolume(volumes []core.Volume) []core.Volume
- func UpsertInterimVolume(kubeClient kubernetes.Interface, podSpec core.PodSpec, ...) (core.PodSpec, error)
- func UpsertPodSecurityContext(currentSC, newSC *core.PodSecurityContext) *core.PodSecurityContext
- func UpsertScratchVolume(volumes []core.Volume) []core.Volume
- func UpsertSecretVolume(volumes []core.Volume, secretName string) []core.Volume
- func UpsertSecurityContext(currentSC, newSC *core.SecurityContext) *core.SecurityContext
- func UpsertTmpVolume(volumes []core.Volume, settings v1beta1_api.EmptyDirSettings) []core.Volume
- func UpsertTmpVolumeMount(volumeMounts []core.VolumeMount) []core.VolumeMount
- func WaitUntilDaemonSetReady(kubeClient kubernetes.Interface, meta metav1.ObjectMeta) error
- func WaitUntilDeploymentConfigReady(c oc_cs.Interface, meta metav1.ObjectMeta) error
- func WaitUntilDeploymentReady(c kubernetes.Interface, meta metav1.ObjectMeta) error
- func WaitUntilPVCReady(c kubernetes.Interface, meta metav1.ObjectMeta) error
- func WaitUntilRCReady(c kubernetes.Interface, meta metav1.ObjectMeta) error
- func WaitUntilReplicaSetReady(c kubernetes.Interface, meta metav1.ObjectMeta) error
- func WaitUntilStatefulSetReady(kubeClient kubernetes.Interface, meta metav1.ObjectMeta) error
- func WaitUntilVolumeSnapshotReady(c snapshot_cs.Interface, meta metav1.ObjectMeta) error
- func WorkloadExists(k8sClient kubernetes.Interface, namespace string, ...) error
- func WorkloadReplicas(kubeClient *kubernetes.Clientset, namespace string, workloadKind string, ...) (int32, error)
- type ExtraOptions
- type RepoLabelData
- type WorkloadClients
Constants ¶
This section is empty.
Variables ¶
var (
ServiceName string
)
Functions ¶
func AttachLocalBackend ¶
func BackupBatchEqual ¶
func BackupBatchEqual(old, new *v1beta1.BackupBatch) bool
BackupBatchEqual check whether two BackupBatches has same specification.
func BackupConfigurationEqual ¶
func BackupConfigurationEqual(old, new *v1beta1_api.BackupConfiguration) bool
BackupConfigurationEqual check whether two BackupConfigurations has same specification.
func BackupModel ¶
func BackupOptionsForBackupTarget ¶
func BackupOptionsForBackupTarget(backupTarget *api.BackupTarget, retentionPolicy api_v1alpha1.RetentionPolicy, extraOpt ExtraOptions) restic.BackupOptions
func BackupPending ¶
func BackupPending(phase v1beta1_api.BackupSessionPhase) bool
func CreateBatchPVC ¶
func CreateBatchPVC(kubeClient kubernetes.Interface, namespace string, pvcList []core.PersistentVolumeClaim) error
CreateBatchPVC creates a batch of PVCs whose definitions has been provided in pvcList argument
func DeleteAllConfigMapLocks ¶
func DeleteAllConfigMapLocks(k8sClient kubernetes.Interface, namespace, name, kind string) error
func DeleteBackupConfigMapLock ¶
func DeleteBackupConfigMapLock(k8sClient kubernetes.Interface, namespace string, r v1beta1_api.TargetRef) error
func DeleteConfigmapLock ¶
func DeleteConfigmapLock(k8sClient kubernetes.Interface, namespace string, workload api.LocalTypedReference) error
func DeleteRestoreConfigMapLock ¶
func DeleteRestoreConfigMapLock(k8sClient kubernetes.Interface, namespace string, r v1beta1_api.TargetRef) error
func EnsureDefaultFunctions ¶
EnsureDefaultFunctions creates "update-status", "pvc-backup" and "pvc-restore" Functions if they are not already present
func EnsureDefaultTasks ¶
EnsureDefaultTasks creates "pvc-backup" and "pvc-restore" Tasks if they are not already present
func EnsureVolumeDeleted ¶
func ExecuteHook ¶
func FindBackupBatch ¶
func FindBackupBatch(lister v1beta1_listers.BackupBatchLister, w *wapi.Workload) (*v1beta1.BackupBatch, error)
FindBackupBatch check if there is any BackupBatch exist for a particular workload. If multiple BackupBatches are found for the workload, it returns error.
func FindBackupConfigForRepository ¶
func FindBackupConfigForRepository(stashClient cs.Interface, repository v1alpha1.Repository) (*v1beta1_api.BackupConfiguration, error)
func FindBackupConfiguration ¶
func FindBackupConfiguration(lister v1beta1_listers.BackupConfigurationLister, w *wapi.Workload) (*v1beta1_api.BackupConfiguration, error)
FindBackupConfiguration check if there is any BackupConfiguration exist for a particular workload. If multiple BackupConfigurations are found for the workload, it returns error.
func FindRestic ¶
func FindRestic(lister stash_listers.ResticLister, obj metav1.ObjectMeta) (*api.Restic, error)
func FindRestoreSession ¶
func FindRestoreSession(lister v1beta1_listers.RestoreSessionLister, w *wapi.Workload) (*v1beta1_api.RestoreSession, error)
FindRestoreSession check if there is any pending RestoreSession exist for a particular workload. If multiple pending RestoreSessions are found for the workload, it returns error.
func FixBackendPrefix ¶
func GetAppliedBackupBatch ¶
func GetAppliedBackupBatch(m map[string]string) (*v1beta1.BackupBatch, error)
GetAppliedBackupBatch check whether BackupBatch was applied as annotation and returns the object definition if exist.
func GetAppliedBackupConfiguration ¶
func GetAppliedBackupConfiguration(m map[string]string) (*v1beta1_api.BackupConfiguration, error)
GetAppliedBackupConfiguration check whether BackupConfiguration was applied as annotation and returns the object definition if exist.
func GetAppliedRestoreSession ¶
func GetAppliedRestoreSession(m map[string]string) (*v1beta1_api.RestoreSession, error)
GetAppliedRestoreSession check whether RestoreSession was applied as annotation and returns the object definition if exist.
func GetBackupConfigmapLockName ¶
func GetBackupConfigmapLockName(r v1beta1_api.TargetRef) string
func GetBucketAndPrefix ¶
TODO: move to store
func GetConfigmapLockName ¶
func GetConfigmapLockName(workload api.LocalTypedReference) string
func GetHostName ¶
GetHostName returns hostname for a target
func GetRestoreConfigmapLockName ¶
func GetRestoreConfigmapLockName(r v1beta1_api.TargetRef) string
func GetRestoreHostName ¶
func GetWorkloadReference ¶
func GetWorkloadReference(w *wapi.Workload) (*core.ObjectReference, error)
GetWorkloadReference return reference of the workload.
func HasOldReplicaAnnotation ¶
func HasOldReplicaAnnotation(k8sClient *kubernetes.Clientset, namespace string, workload api.LocalTypedReference) bool
func HasStashContainer ¶
func HasStashInitContainer ¶
func HasStashSidecar ¶
func HookExecutorContainer ¶
func IONiceSettingsFromEnv ¶
func IONiceSettingsFromEnv() (*v1.IONiceSettings, error)
func IsBackupTarget ¶
func IsBackupTarget(target *v1beta1_api.BackupTarget, w *wapi.Workload) bool
func IsRestoreTarget ¶
func IsRestoreTarget(target *v1beta1_api.RestoreTarget, w *wapi.Workload) bool
func MergeLocalVolume ¶
func NewCheckJob ¶
func NewInitContainer ¶
func NewInitContainer(r *v1alpha1_api.Restic, workload v1alpha1_api.LocalTypedReference, image docker.Docker) core.Container
func NewPVCRestorerJob ¶
func NewPVCRestorerJob(rs *api_v1beta1.RestoreSession, repository *api_v1alpha1.Repository, image docker.Docker) (*core.PodTemplateSpec, error)
NewPVCRestorerJob return a job definition to restore pvc.
func NewRecoveryJob ¶
func NewRestoreInitContainer ¶
func NewRestoreInitContainer(rs *v1beta1_api.RestoreSession, repository *v1alpha1_api.Repository, image docker.Docker) core.Container
func NewSidecarContainer ¶
func NewVolumeRestorerJob ¶
func NewVolumeRestorerJob(rs *api_v1beta1.RestoreSession, image docker.Docker) (*core.PodTemplateSpec, error)
func NewVolumeSnapshotterJob ¶
func NewVolumeSnapshotterJob(bs *api_v1beta1.BackupSession, backupTarget *api_v1beta1.BackupTarget, runtimeSettings v1.RuntimeSettings, image docker.Docker) (*core.PodTemplateSpec, error)
func NiceSettingsFromEnv ¶
func NiceSettingsFromEnv() (*v1.NiceSettings, error)
func PVCListToVolumes ¶
func PVCListToVolumes(pvcList []core.PersistentVolumeClaim, ordinal int32) []core.Volume
PVCListToVolumes return a list of volumes to mount in pod for a list of PVCs
func ParseInt32P ¶
func PushgatewayURL ¶
func PushgatewayURL() string
func RecoveryEqual ¶
func ResourceKindShortForm ¶
xref: https://kubernetes.io/docs/reference/kubectl/overview/#resource-types
func ResticEqual ¶
func RestoreOptionForRestoreSession ¶
func RestoreOptionForRestoreSession(restoreSession api.RestoreSession, extraOpt ExtraOptions) restic.RestoreOptions
func RestoreOptionsForHost ¶
func RestoreOptionsForHost(hostname string, rules []api.Rule) restic.RestoreOptions
return the matching rule if targetHosts is empty for a rule, it will match any hostname
func RestoreSessionEqual ¶
func RestoreSessionEqual(old, new *v1beta1_api.RestoreSession) bool
RestoreSessionEqual check whether two RestoreSessions has same specification.
func SetupOptionsForRepository ¶
func SetupOptionsForRepository(repository api_v1alpha1.Repository, extraOpt ExtraOptions) (restic.SetupOptions, error)
func UpsertDefaultPodSecurityContext ¶
func UpsertDefaultPodSecurityContext(currentSC *core.PodSecurityContext) *core.PodSecurityContext
func UpsertDownwardVolume ¶
func UpsertInterimVolume ¶
func UpsertInterimVolume(kubeClient kubernetes.Interface, podSpec core.PodSpec, interimVolumeTemplate *core.PersistentVolumeClaim, namespace string, owner *metav1.OwnerReference) (core.PodSpec, error)
UpsertInterimVolume create a PVC according to InterimVolumeTemplate and attach it to the respective pod
func UpsertPodSecurityContext ¶
func UpsertPodSecurityContext(currentSC, newSC *core.PodSecurityContext) *core.PodSecurityContext
UpsertPodSecurityContext update current SecurityContext with new SecurityContext. If a field is not present in the new SecurityContext, value of the current SecurityContext for this field will be used.
func UpsertSecretVolume ¶
func UpsertSecurityContext ¶
func UpsertSecurityContext(currentSC, newSC *core.SecurityContext) *core.SecurityContext
UpsertSecurityContext update current SecurityContext with new SecurityContext. If a field is not present in the new SecurityContext, value of the current SecurityContext for this field will be used.
func UpsertTmpVolume ¶
func UpsertTmpVolume(volumes []core.Volume, settings v1beta1_api.EmptyDirSettings) []core.Volume
func UpsertTmpVolumeMount ¶
func UpsertTmpVolumeMount(volumeMounts []core.VolumeMount) []core.VolumeMount
func WaitUntilDaemonSetReady ¶
func WaitUntilDaemonSetReady(kubeClient kubernetes.Interface, meta metav1.ObjectMeta) error
func WaitUntilDeploymentConfigReady ¶
func WaitUntilDeploymentConfigReady(c oc_cs.Interface, meta metav1.ObjectMeta) error
func WaitUntilDeploymentReady ¶
func WaitUntilDeploymentReady(c kubernetes.Interface, meta metav1.ObjectMeta) error
func WaitUntilPVCReady ¶
func WaitUntilPVCReady(c kubernetes.Interface, meta metav1.ObjectMeta) error
func WaitUntilRCReady ¶
func WaitUntilRCReady(c kubernetes.Interface, meta metav1.ObjectMeta) error
func WaitUntilReplicaSetReady ¶
func WaitUntilReplicaSetReady(c kubernetes.Interface, meta metav1.ObjectMeta) error
func WaitUntilStatefulSetReady ¶
func WaitUntilStatefulSetReady(kubeClient kubernetes.Interface, meta metav1.ObjectMeta) error
func WaitUntilVolumeSnapshotReady ¶
func WaitUntilVolumeSnapshotReady(c snapshot_cs.Interface, meta metav1.ObjectMeta) error
func WorkloadExists ¶
func WorkloadExists(k8sClient kubernetes.Interface, namespace string, workload api.LocalTypedReference) error
func WorkloadReplicas ¶
Types ¶
type ExtraOptions ¶
type ExtraOptions struct { Host string SecretDir string CacertFile string ScratchDir string EnableCache bool }
options that don't come from repository, backup-config, backup-session, restore-session
type RepoLabelData ¶
type RepoLabelData struct { WorkloadKind string WorkloadName string PodName string NodeName string }
func ExtractDataFromRepositoryLabel ¶
func ExtractDataFromRepositoryLabel(labels map[string]string) (data RepoLabelData, err error)
type WorkloadClients ¶
type WorkloadClients struct { KubeClient kubernetes.Interface OcClient oc_cs.Interface StashClient cs.Interface CRDClient crd_cs.ApiextensionsV1beta1Interface AppCatalogClient appcatalog_cs.Interface }
func (*WorkloadClients) IsTargetExist ¶
func (wc *WorkloadClients) IsTargetExist(target api_v1beta1.TargetRef, namespace string) bool