backup

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2018 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPodCommandExecutor added in v0.5.0

func NewPodCommandExecutor(restClientConfig *rest.Config, restClient poster) podCommandExecutor

NewPodCommandExecutor creates a new podCommandExecutor.

Types

type Backupper

type Backupper interface {
	// Backup takes a backup using the specification in the api.Backup and writes backup and log data
	// to the given writers.
	Backup(backup *api.Backup, backupFile, logFile io.Writer, actions []ItemAction) error
}

Backupper performs backups.

func NewKubernetesBackupper

func NewKubernetesBackupper(
	discoveryHelper discovery.Helper,
	dynamicFactory client.DynamicFactory,
	podCommandExecutor podCommandExecutor,
	snapshotService cloudprovider.SnapshotService,
) (Backupper, error)

NewKubernetesBackupper creates a new kubernetesBackupper.

type ItemAction added in v0.6.0

type ItemAction interface {
	// AppliesTo returns information about which resources this action should be invoked for.
	// An ItemAction's Execute function will only be invoked on items that match the returned
	// selector. A zero-valued ResourceSelector matches all resources.
	AppliesTo() (ResourceSelector, error)

	// Execute allows the ItemAction to perform arbitrary logic with the item being backed up,
	// including mutating the item itself prior to backup. The item (unmodified or modified)
	// should be returned, along with an optional slice of ResourceIdentifiers specifying
	// additional related items that should be backed up.
	Execute(item runtime.Unstructured, backup *api.Backup) (runtime.Unstructured, []ResourceIdentifier, error)
}

ItemAction is an actor that performs an operation on an individual item being backed up.

func NewBackupPVAction added in v0.5.0

func NewBackupPVAction(log logrus.FieldLogger) ItemAction

func NewPodAction added in v0.7.0

func NewPodAction(log logrus.FieldLogger) ItemAction

NewPodAction creates a new ItemAction for pods.

type ItemBackupper added in v0.5.0

type ItemBackupper interface {
	// contains filtered or unexported methods
}

type ResourceIdentifier added in v0.5.0

type ResourceIdentifier struct {
	schema.GroupResource
	Namespace string
	Name      string
}

ResourceIdentifier describes a single item by its group, resource, namespace, and name.

type ResourceSelector added in v0.6.0

type ResourceSelector struct {
	// IncludedNamespaces is a slice of namespace names to match. All
	// namespaces in this slice, except those in ExcludedNamespaces,
	// will be matched. A nil/empty slice matches all namespaces.
	IncludedNamespaces []string
	// ExcludedNamespaces is a slice of namespace names to exclude.
	// All namespaces in IncludedNamespaces, *except* those in
	// this slice, will be matched.
	ExcludedNamespaces []string
	// IncludedResources is a slice of resources to match. Resources
	// may be specified as full names (e.g. "services") or abbreviations
	// (e.g. "svc"). All resources in this slice, except those in
	// ExcludedResources, will be matched. A nil/empty slice matches
	// all resources.
	IncludedResources []string
	// ExcludedResources is a slice of resources to exclude.
	// Resources may be specified as full names (e.g. "services") or
	// abbreviations (e.g. "svc"). All resources in IncludedResources,
	// *except* those in this slice, will be matched.
	ExcludedResources []string
	// LabelSelector is a string representation of a selector to apply
	// when matching resources. See "k8s.io/apimachinery/pkg/labels".Parse()
	// for details on syntax.
	LabelSelector string
}

ResourceSelector is a collection of included/excluded namespaces, included/excluded resources, and a label-selector that can be used to match a set of items from a cluster.

Jump to

Keyboard shortcuts

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