resourcecollector

package
v2.5.0-rc3+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 30 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SkipResource

func SkipResource(annotations map[string]string) bool

SkipResource returns whether the annotations of the object require it to be skipped

Types

type ResourceCollector

type ResourceCollector struct {
	Driver volume.Driver
	// contains filtered or unexported fields
}

ResourceCollector is used to collect and process unstructured objects in namespaces and using label selectors

func (*ResourceCollector) ApplyResource

func (r *ResourceCollector) ApplyResource(
	dynamicInterface dynamic.Interface,
	object runtime.Unstructured,
) error

ApplyResource applies a given resource using the provided client interface

func (*ResourceCollector) DeleteResources

func (r *ResourceCollector) DeleteResources(
	dynamicInterface dynamic.Interface,
	objects []runtime.Unstructured,
) error

DeleteResources deletes given resources using the provided client interface

func (*ResourceCollector) GetResources

func (r *ResourceCollector) GetResources(
	namespaces []string,
	labelSelectors map[string]string,
	includeObjects map[stork_api.ObjectInfo]bool,
	optionalResourceTypes []string,
	allDrivers bool) ([]runtime.Unstructured, error)

GetResources gets all the resources in the given list of namespaces which match the labelSelectors

func (*ResourceCollector) Init

func (r *ResourceCollector) Init(config *restclient.Config) error

Init initializes the resource collector

func (*ResourceCollector) PrepareResourceForApply

func (r *ResourceCollector) PrepareResourceForApply(
	object runtime.Unstructured,
	includeObjects map[stork_api.ObjectInfo]bool,
	namespaceMappings map[string]string,
	pvNameMappings map[string]string,
	optionalResourceTypes []string,
) (bool, error)

PrepareResourceForApply prepares the resource for apply including update namespace and any PV name updates. Should be called before DeleteResources and ApplyResource

Jump to

Keyboard shortcuts

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