Documentation ¶
Index ¶
- Constants
- func GetBackupName(veleroBackup velerov1.Backup) string
- func GetBackupTrigger(veleroBackup velerov1.Backup) string
- func GetInstanceBackupCount(veleroBackup velerov1.Backup) int
- func GetInstanceBackupType(veleroBackup velerov1.Backup) string
- func GetInstanceBackupVersion(veleroBackup velerov1.Backup) string
- func IsInstanceBackup(veleroBackup velerov1.Backup) bool
- type App
- type Backup
- type BackupDetail
- type BackupStatus
- type ParsedTTL
- type RestoreDetail
- type RestoreVolume
- type ScheduledInstanceSnapshot
- type ScheduledSnapshot
- type SnapshotError
- type SnapshotHook
- type SnapshotSchedule
- type SnapshotTTL
- type SnapshotVolume
- type VolumeSummary
Constants ¶
const ( // BackupIsECAnnotation is the annotation used to store if the backup is from an EC install. BackupIsECAnnotation = "kots.io/embedded-cluster" // InstanceBackupNameLabel is the label used to store the name of the backup for an instance // backup. InstanceBackupNameLabel = "replicated.com/backup-name" // InstanceBackupTypeAnnotation is the annotation used to store the type of backup for an // instance backup. InstanceBackupTypeAnnotation = "replicated.com/backup-type" // InstanceBackupCountAnnotation is the annotation used to store the expected number of backups // for an instance backup. InstanceBackupCountAnnotation = "replicated.com/backup-count" // InstanceBackupRestoreSpecAnnotation is the annotation used to store the corresponding restore // spec for an instance backup. InstanceBackupRestoreSpecAnnotation = "replicated.com/restore-spec" // InstanceBackupTypeInfra indicates that the backup is of type infrastructure. InstanceBackupTypeInfra = "infra" // InstanceBackupTypeApp indicates that the backup is of type application. InstanceBackupTypeApp = "app" // InstanceBackupTypeLegacy indicates that the backup is of type legacy (infra + app). InstanceBackupTypeLegacy = "legacy" // InstanceBackupAnnotation is the annotation used to indicate that a backup is a legacy // instance backup. InstanceBackupAnnotation = "kots.io/instance" // InstanceBackupVersionAnnotation is the annotation used to store the version of the backup // for an instance (DR) backup. InstanceBackupVersionAnnotation = "replicated.com/disaster-recovery-version" // InstanceBackupVersion1 indicates that the backup is of version 1. InstanceBackupVersion1 = "1" // InstanceBackupVersionCurrent is the current backup version. When future breaking changes are // introduced, we can increment this number on backup creation. InstanceBackupVersionCurrent = InstanceBackupVersion1 // BackupTriggerAnnotation is the annotation used to store the trigger of the backup. BackupTriggerAnnotation = "kots.io/snapshot-trigger" // BackupTriggerManual indicates that the backup was triggered manually. BackupTriggerManual = "manual" // BackupTriggerSchedule indicates that the backup was triggered by a schedule. BackupTriggerSchedule = "schedule" BackupAppsSequencesAnnotation = "kots.io/apps-sequences" )
Variables ¶
This section is empty.
Functions ¶
func GetBackupName ¶ added in v1.122.1
GetBackupName returns the name of the backup from the velero backup object label.
func GetBackupTrigger ¶ added in v1.122.1
GetBackupTrigger returns the trigger of the backup from the velero backup object annotation.
func GetInstanceBackupCount ¶ added in v1.122.1
GetInstanceBackupCount returns the expected number of backups from the velero backup object annotation.
func GetInstanceBackupType ¶ added in v1.122.1
GetInstanceBackupType returns the type of the backup from the velero backup object annotation.
func GetInstanceBackupVersion ¶ added in v1.122.1
GetInstanceBackupVersion returns the version of the backup from the velero backup object annotation.
func IsInstanceBackup ¶ added in v1.122.1
IsInstanceBackup returns true if the backup is an instance backup.
Types ¶
type Backup ¶
type Backup struct { Name string `json:"name"` Status BackupStatus `json:"status"` Trigger string `json:"trigger"` AppID string `json:"appID"` // TODO: remove with app backups Sequence int64 `json:"sequence"` // TODO: remove with app backups StartedAt *time.Time `json:"startedAt,omitempty"` FinishedAt *time.Time `json:"finishedAt,omitempty"` ExpiresAt *time.Time `json:"expiresAt,omitempty"` SupportBundleID string `json:"supportBundleId,omitempty"` IncludedApps []App `json:"includedApps,omitempty"` // number of velero backups expected to exist for the Backup to be considered done ExpectedBackupCount int `json:"expectedBackupCount"` // number of velero backups that actually exist BackupCount int `json:"backupCount"` VolumeSummary }
Backup represnts a replicated backup working as an abstraction layer between Replicated and Velero backups. These can be either infrastructure/instance, app backups or both.
type BackupDetail ¶
type BackupDetail struct { Name string `json:"name"` Type string `json:"type"` Status string `json:"status"` VolumeSizeHuman string `json:"volumeSizeHuman"` Namespaces []string `json:"namespaces"` Hooks []*SnapshotHook `json:"hooks"` Volumes []SnapshotVolume `json:"volumes"` Errors []SnapshotError `json:"errors"` Warnings []SnapshotError `json:"warnings"` }
type BackupStatus ¶ added in v1.122.1
type BackupStatus string
BackupStatus represents the status of a backup
const ( // BackupStatusInProgress indicates that the backup is currently in progress BackupStatusInProgress BackupStatus = "InProgress" // BackupStatusCompleted indicates that the backup has been completed successfully BackupStatusCompleted BackupStatus = "Completed" // BackupStatusFailed indicates that the backup has failed BackupStatusFailed BackupStatus = "Failed" // BackupStatusDeleting indicates that the backup is being deleted BackupStatusDeleting BackupStatus = "Deleting" )
func GetStatusFromBackupPhase ¶ added in v1.122.1
func GetStatusFromBackupPhase(phase velerov1.BackupPhase) BackupStatus
GetStatusFromBackupPhase returns our backup status from the velero backup phase.
func RollupStatus ¶ added in v1.122.1
func RollupStatus(backupStatuses []BackupStatus) BackupStatus
RollupStatus returns the overall status of a list of backup statuses. This is particularly useful when we have multiple velero backups for a single Replicated backup.
type RestoreDetail ¶
type RestoreDetail struct { Name string `json:"name"` Phase velerov1.RestorePhase `json:"phase"` Volumes []RestoreVolume `json:"volumes"` Errors []SnapshotError `json:"errors"` Warnings []SnapshotError `json:"warnings"` }
type RestoreVolume ¶
type RestoreVolume struct { Name string `json:"name"` PodName string `json:"podName"` PodNamespace string `json:"podNamespace"` PodVolumeName string `json:"podVolumeName"` SizeBytesHuman string `json:"sizeBytesHuman"` DoneBytesHuman string `json:"doneBytesHuman"` CompletionPercent int `json:"completionPercent"` RemainingSecondsExist bool `json:"remainingSecondsExist"` TimeRemainingSeconds int `json:"timeRemainingSeconds"` StartedAt *time.Time `json:"startedAt,omitempty"` FinishedAt *time.Time `json:"finishedAt,omitempty"` Phase string `json:"phase"` }
type ScheduledSnapshot ¶
type SnapshotError ¶
type SnapshotHook ¶
type SnapshotHook struct { Name string `json:"name"` Namespace string `json:"namespace"` Phase string `json:"phase"` PodName string `json:"podName"` ContainerName string `json:"containerName"` Command string `json:"command"` Stdout string `json:"stdout"` Stderr string `json:"stderr"` StartedAt *time.Time `json:"startedAt,omitempty"` FinishedAt *time.Time `json:"finishedAt,omitempty"` Errors []SnapshotError `json:"errors"` Warnings []SnapshotError `json:"warnings"` }
type SnapshotSchedule ¶
type SnapshotSchedule struct {
Schedule string `json:"schedule"`
}
type SnapshotTTL ¶
type SnapshotVolume ¶
type SnapshotVolume struct { Name string `json:"name"` PodName string `json:"podName"` PodNamespace string `json:"podNamespace"` PodVolumeName string `json:"podVolumeName"` SizeBytesHuman string `json:"sizeBytesHuman"` DoneBytesHuman string `json:"doneBytesHuman"` CompletionPercent int `json:"completionPercent"` TimeRemainingSeconds int `json:"timeRemainingSeconds"` StartedAt *time.Time `json:"startedAt,omitempty"` FinishedAt *time.Time `json:"finishedAt,omitempty"` Phase string `json:"phase"` }