Documentation ¶
Overview ¶
Package velero contains the interfaces necessary to implement all of the Velero plugins. Users create their own binary containing implementations of the plugin kinds in this package. Multiple plugins of any type can be implemented.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Applicable ¶ added in v1.8.0
type Applicable interface { // AppliesTo returns information about which resources this Responder should be invoked for. AppliesTo() (ResourceSelector, error) }
Applicable allows actions and plugins to specify which resources they should be invoked for
type DeleteItemAction ¶ added in v1.5.0
type DeleteItemAction interface { // AppliesTo returns information about which resources this action should be invoked for. // A DeleteItemAction'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 deleted. // An error should be returned if there were problems with the deletion process, but the // overall deletion process cannot be stopped. // Returned errors are logged. Execute(input *DeleteItemActionExecuteInput) error }
DeleteItemAction is an actor that performs an operation on an individual item being restored.
type DeleteItemActionExecuteInput ¶ added in v1.5.0
type DeleteItemActionExecuteInput struct { // Item is the item taken from the pristine backed up version of resource. Item runtime.Unstructured // Backup is the representation of the restore resource processed by Velero. Backup *velerov1api.Backup }
DeleteItemActionExecuteInput contains the input parameters for the ItemAction's Execute function.
type ObjectStore ¶
type ObjectStore interface { // Init prepares the ObjectStore for usage using the provided map of // configuration key-value pairs. It returns an error if the ObjectStore // cannot be initialized from the provided config. Init(config map[string]string) error // PutObject creates a new object using the data in body within the specified // object storage bucket with the given key. PutObject(bucket, key string, body io.Reader) error // ObjectExists checks if there is an object with the given key in the object storage bucket. ObjectExists(bucket, key string) (bool, error) // GetObject retrieves the object with the given key from the specified // bucket in object storage. GetObject(bucket, key string) (io.ReadCloser, error) // ListCommonPrefixes gets a list of all object key prefixes that start with // the specified prefix and stop at the next instance of the provided delimiter. // // For example, if the bucket contains the following keys: // a-prefix/foo-1/bar // a-prefix/foo-1/baz // a-prefix/foo-2/baz // some-other-prefix/foo-3/bar // and the provided prefix arg is "a-prefix/", and the delimiter is "/", // this will return the slice {"a-prefix/foo-1/", "a-prefix/foo-2/"}. ListCommonPrefixes(bucket, prefix, delimiter string) ([]string, error) // ListObjects gets a list of all keys in the specified bucket // that have the given prefix. ListObjects(bucket, prefix string) ([]string, error) // DeleteObject removes the object with the specified key from the given // bucket. DeleteObject(bucket, key string) error // CreateSignedURL creates a pre-signed URL for the given bucket and key that expires after ttl. CreateSignedURL(bucket, key string, ttl time.Duration) (string, error) }
ObjectStore exposes basic object-storage operations required by Velero.
type ResourceIdentifier ¶
type ResourceIdentifier struct { schema.GroupResource Namespace string Name string }
ResourceIdentifier describes a single item by its group, resource, namespace, and name.
type ResourceSelector ¶
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"), abbreviations (e.g. "svc"), or with the // groups they are in (e.g. "ingresses.extensions"). 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"), abbreviations (e.g. "svc"), or with the // groups they are in (e.g. "ingresses.extensions"). 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.
type RestoreItemActionExecuteInput ¶
type RestoreItemActionExecuteInput struct { // Item is the item being restored. It is likely different from the pristine backed up version // (metadata reset, changed by various restore item action plugins, etc.). Item runtime.Unstructured // ItemFromBackup is the item taken from the pristine backed up version of resource. ItemFromBackup runtime.Unstructured // Restore is the representation of the restore resource processed by Velero. Restore *api.Restore }
RestoreItemActionExecuteInput contains the input parameters for the ItemAction's Execute function.
type RestoreItemActionExecuteOutput ¶
type RestoreItemActionExecuteOutput struct { // UpdatedItem is the item being restored mutated by ItemAction. UpdatedItem runtime.Unstructured // AdditionalItems is a list of additional related items that should // be restored. AdditionalItems []ResourceIdentifier // SkipRestore tells velero to stop executing further actions // on this item, and skip the restore step. When this field's // value is true, AdditionalItems will be ignored. SkipRestore bool }
RestoreItemActionExecuteOutput contains the output variables for the ItemAction's Execution function.
func NewRestoreItemActionExecuteOutput ¶
func NewRestoreItemActionExecuteOutput(item runtime.Unstructured) *RestoreItemActionExecuteOutput
NewRestoreItemActionExecuteOutput creates a new RestoreItemActionExecuteOutput
func (*RestoreItemActionExecuteOutput) WithoutRestore ¶
func (r *RestoreItemActionExecuteOutput) WithoutRestore() *RestoreItemActionExecuteOutput
WithoutRestore returns SkipRestore for RestoreItemActionExecuteOutput