Documentation ¶
Index ¶
- Constants
- Variables
- func VeleroCRDsPresent(ctx context.Context, c client.Client) (bool, error)
- type ACMRestoreHelper
- type BackupDeleteRequest
- type BackupHelper
- type BackupScheduleHelper
- type BackupScheduleReconciler
- type ChannelHelper
- type DynamicStruct
- type ManagedHelper
- type ResourceType
- type RestoreHelper
- type RestoreOptions
- type RestoreReconciler
- type ScheduleHelper
- type SecretType
- type SortResourceType
- type StorageLocationHelper
Constants ¶
const ( // FailedPhaseMsg for when Velero schedule initialization failed FailedPhaseMsg string = "Velero schedules initialization failed" // NewPhaseMsg for when Velero schedule initialization succeeded NewPhaseMsg string = "Velero schedules are initialized" // EnabledPhaseMsg for when Velero schedules are processed by velero and enabled EnabledPhaseMsg string = "Velero schedules are enabled" // UnknownPhaseMsg for when some Velero schedules are not enabled UnknownPhaseMsg string = "Some Velero schedules are not enabled. " + "If the status doesn't change check the velero pod is running and " + "that you have created a Velero resource as documented in the install guide." // BackupCollisionPhaseMsg when another cluster is creating backups at the same storage location BackupCollisionPhaseMsg string = "Backup %s, from cluster with id [%s] is using the same storage location." + " This is a backup collision with current cluster [%s] backup." + " Review and resolve the collision then create a new BackupSchedule resource to " + " resume backups from this cluster." // Collision when another hub had run the restore managed cluster operation while this cluster schedule is active BackupCollisionRestoreMsg string = "Hub with id [%s] had run a restore managed cluster operation, see [%s]." + " Current hub is no longer the active cluster so the BackupSchedule is set to backup collision." + " Review and resolve the collision then create a new BackupSchedule resource " + " from this hub, or from the [%s] hub." )
const ( // RestoreClusterLabel is the label key used to identify the cluster id // that had run a restore clusters operation, so it had become the active hub RestoreClusterLabel string = "cluster.open-cluster-management.io/restore-cluster" )
Variables ¶
var ( // BackupScheduleNameLabel is the label key used to identify the backup schedule by name. BackupScheduleNameLabel string = "cluster.open-cluster-management.io/backup-schedule-name" // BackupScheduleTypeLabel is the label key used to identify the type of the backup schedule BackupScheduleTypeLabel string = "cluster.open-cluster-management.io/backup-schedule-type" // BackupScheduleClusterUIDLabel is the label key used to identify the cluster id that generated the backup BackupScheduleClusterLabel string = "cluster.open-cluster-management.io/backup-cluster" // BackupScheduleActivationLabel stores the name of the restore resources that resulted in creating this backup BackupScheduleActivationLabel string = "cluster.open-cluster-management.io/backup-activation-restore" // label for backups generated from velero schedules BackupVeleroLabel string = "velero.io/schedule-name" // label for backups generated from velero schedules BackupNameVeleroLabel string = "velero.io/backup-name" ClusterActivationLabel string = "cluster-activation" ExcludeBackupLabel string = "velero.io/exclude-from-backup" )
var (
// PublicAPIServerURL the public URL for the APIServer
PublicAPIServerURL = ""
)
var ResourceTypePriority map[ResourceType]int = map[ResourceType]int{
Credentials: 0,
CredentialsHive: 1,
CredentialsCluster: 2,
Resources: 3,
ResourcesGeneric: 4,
ManagedClusters: 5,
}
resources should be restored in this order, higher priority starting from 0
Functions ¶
Types ¶
type ACMRestoreHelper ¶
type ACMRestoreHelper struct {
// contains filtered or unexported fields
}
acm restore
type BackupDeleteRequest ¶
type BackupDeleteRequest struct {
// contains filtered or unexported fields
}
type BackupHelper ¶
type BackupHelper struct {
// contains filtered or unexported fields
}
backup helper
type BackupScheduleHelper ¶
type BackupScheduleHelper struct {
// contains filtered or unexported fields
}
backup schedule
type BackupScheduleReconciler ¶
type BackupScheduleReconciler struct { client.Client DiscoveryClient discovery.DiscoveryInterface DynamicClient dynamic.Interface Scheme *runtime.Scheme }
BackupScheduleReconciler reconciles a BackupSchedule object
func (*BackupScheduleReconciler) Reconcile ¶
func (r *BackupScheduleReconciler) Reconcile( ctx context.Context, req ctrl.Request, ) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile
func (*BackupScheduleReconciler) SetupWithManager ¶
func (r *BackupScheduleReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ChannelHelper ¶
type ChannelHelper struct {
// contains filtered or unexported fields
}
channel helper
type DynamicStruct ¶
type DynamicStruct struct {
// contains filtered or unexported fields
}
type ManagedHelper ¶
type ManagedHelper struct {
// contains filtered or unexported fields
}
managed cluster helper
type ResourceType ¶
type ResourceType string
ResourceType is the type to contain resource type string value
const ( // ManagedClusters resource type ManagedClusters ResourceType = "managedClusters" // Credentials resource type for user created credentials Credentials ResourceType = "credentials" // CredentialsHive resource type for hive secrets CredentialsHive ResourceType = "credentialsHive" // CredentialsCluster Credentials resource type for managed cluster secrets CredentialsCluster ResourceType = "credentialsCluster" // Resources related to applications and policies Resources ResourceType = "resources" // schedule used by the backup Policy to validate that there are active backups running // and stored to the storage location, using the schedule cron time ValidationSchedule = "validation" // ResourcesGeneric Genric Resources related to applications and policies // these are user resources, except secrets, labeled with cluster.open-cluster-management.io/backup // secrets labeled with cluster.open-cluster-management.io/backup are already backed up under credentialsCluster ResourcesGeneric ResourceType = "resourcesGeneric" )
type RestoreHelper ¶
type RestoreHelper struct {
// contains filtered or unexported fields
}
velero restore
type RestoreOptions ¶
type RestoreOptions struct {
// contains filtered or unexported fields
}
type RestoreReconciler ¶
type RestoreReconciler struct { client.Client KubeClient kubernetes.Interface DiscoveryClient discovery.DiscoveryInterface DynamicClient dynamic.Interface Scheme *runtime.Scheme Recorder record.EventRecorder }
RestoreReconciler reconciles a Restore object
func (*RestoreReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
func (*RestoreReconciler) SetupWithManager ¶
func (r *RestoreReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ScheduleHelper ¶
type ScheduleHelper struct {
// contains filtered or unexported fields
}
velero schedule helper
type SecretType ¶
type SecretType string
SecretType is the type of secret
const ( // HiveSecret hive created secrets HiveSecret SecretType = "hive" // ClusterSecret managed cluster secrets ClusterSecret SecretType = "cluster" // UserSecret user defined secrets UserSecret SecretType = "user" )
type SortResourceType ¶
type SortResourceType []ResourceType
SortResourceType implements sort.Interface
func (SortResourceType) Len ¶
func (a SortResourceType) Len() int
func (SortResourceType) Less ¶
func (a SortResourceType) Less(i, j int) bool
func (SortResourceType) Swap ¶
func (a SortResourceType) Swap(i, j int)
type StorageLocationHelper ¶
type StorageLocationHelper struct {
// contains filtered or unexported fields
}
storage location