common

package
v0.0.0-...-8461d3d Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommonBackupAnnotationName  string = "hypershift.openshift.io/common-backup-plugin"
	CommonRestoreAnnotationName string = "hypershift.openshift.io/common-restore-plugin"

	BackupStatusInProgress BackupStatus  = "InProgress"
	BackupStatusCompleted  BackupStatus  = "Completed"
	RestoreDone            RestoreStatus = "true"
)

Variables

View Source
var (
	CustomScheme = runtime.NewScheme()
)

Functions

func GetClient

func GetClient() (crclient.Client, error)

GetClient creates a controller-runtime client for Kubernetes

func GetConfig

func GetConfig() (*rest.Config, error)

func ManagePauseHostedCluster

func ManagePauseHostedCluster(ctx context.Context, client crclient.Client, log logrus.FieldLogger, paused string, header string, namespaces []string) error

func ManagePauseNodepools

func ManagePauseNodepools(ctx context.Context, client crclient.Client, log logrus.FieldLogger, paused string, header string, namespaces []string) error

func WaitForDataUpload

func WaitForDataUpload(ctx context.Context, client crclient.Client, log logrus.FieldLogger, backup *v1.Backup) (bool, error)

WaitForBackupCompleted waits for the backup to be completed and uploaded to the destination backend it returns true if the backup was completed successfully, false otherwise.

func WaitForPausedPropagated

func WaitForPausedPropagated(ctx context.Context, client crclient.Client, log logrus.FieldLogger, hc *hyperv1.HostedCluster) error

Types

type BackupPlugin

type BackupPlugin struct {
	DataUploadDone bool
	// contains filtered or unexported fields
}

BackupPlugin is a backup item action plugin for Hypershift common objects.

func NewBackupPlugin

func NewBackupPlugin(log logrus.FieldLogger) *BackupPlugin

NewBackupPlugin instantiates BackupPlugin.

func (*BackupPlugin) AppliesTo

func (p *BackupPlugin) AppliesTo() (velero.ResourceSelector, error)

AppliesTo returns information about which resources this action should be invoked for. The IncludedResources and ExcludedResources slices can include both resources and resources with group names. These work: "ingresses", "ingresses.extensions". A BackupPlugin's Execute function will only be invoked on items that match the returned selector. A zero-valued ResourceSelector matches all resources.

func (*BackupPlugin) Execute

Execute allows the ItemAction to perform arbitrary logic with the item being backed up, in this case, setting a custom annotation on the item being backed up.

func (*BackupPlugin) Name

func (p *BackupPlugin) Name() string

Name is required to implement the interface, but the Velero pod does not delegate this method -- it's used to tell velero what name it was registered under. The plugin implementation must define it, but it will never actually be called.

type BackupStatus

type BackupStatus string

type RestorePlugin

type RestorePlugin struct {
	// contains filtered or unexported fields
}

RestorePlugin is a restore item action plugin for hypershift common objects.

func NewRestorePlugin

func NewRestorePlugin(log logrus.FieldLogger) *RestorePlugin

NewRestorePlugin instantiates a RestorePlugin.

func (*RestorePlugin) AppliesTo

func (p *RestorePlugin) AppliesTo() (velero.ResourceSelector, error)

AppliesTo returns information about which resources this action should be invoked for. The IncludedResources and ExcludedResources slices can include both resources and resources with group names. These work: "ingresses", "ingresses.extensions". A RestoreItemAction's Execute function will only be invoked on items that match the returned selector. A zero-valued ResourceSelector matches all resources.

func (*RestorePlugin) Execute

Execute sets a custom annotation on the item being restored.

func (*RestorePlugin) Name

func (p *RestorePlugin) Name() string

Name is required to implement the interface, but the Velero pod does not delegate this method -- it's used to tell velero what name it was registered under. The plugin implementation must define it, but it will never actually be called.

type RestoreStatus

type RestoreStatus string

Jump to

Keyboard shortcuts

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