velero

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRestoreNamespace

func GetRestoreNamespace(ns, bkpName string, log logrus.FieldLogger) (string, error)

GetRestoreNamespace return the namespace mapping for the given namespace if namespace mapping not found then it will return the same namespace in which backup was created if namespace mapping found then it will return the mapping/target namespace

velero doesn't pass the restore name to plugin, so we are following the below approach to fetch the namespace mapping:

plugin find the relevant restore from the sorted list(creationTimestamp in decreasing order) of restore resource using following criteria:

  • retore is in in-progress state AND backup for that restore matches with the backup name from snapshotID

Above approach works because velero support sequential restore

func InitializeClientSet

func InitializeClientSet(config *rest.Config) error

InitializeClientSet initialize velero clientset

Types

type RestoreByCreationTimestamp

type RestoreByCreationTimestamp []velerov1api.Restore

RestoreByCreationTimestamp sorts a list of Restore by creation timestamp, using their names as a tie breaker.

func (RestoreByCreationTimestamp) Len

func (RestoreByCreationTimestamp) Less

func (o RestoreByCreationTimestamp) Less(i, j int) bool

func (RestoreByCreationTimestamp) Swap

func (o RestoreByCreationTimestamp) Swap(i, j int)

Jump to

Keyboard shortcuts

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