Documentation ¶
Index ¶
Constants ¶
View Source
const ListObjectsLimit = 200
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GVResource ¶
type GVResource struct { GroupVersion schema.GroupVersion Name string Namespaced bool }
type ResourceHandler ¶
type ResourceHandler struct { DiscoveryClient discovery.DiscoveryInterface DynamicClient dynamic.Interface TransformerMap map[schema.GroupResource]value.Transformer GVResourceToObjects map[GVResource][]unstructured.Unstructured }
func (*ResourceHandler) GatherResources ¶
func (h *ResourceHandler) GatherResources(ctx context.Context, resourceSelectors []v1.ResourceSelector) (map[string]bool, error)
GatherResources iterates over the ResourceSelectors in the given ResourceSet Each ResourceSelector can specify only one apigroupversion, example "v1" or "management.cattle.io/v3" ResourceSelector can specify resource types/kinds to backup from this apigroupversion through Kinds and KindsRegexp. Resources matching Kinds and KindsRegexp both will be backed up ResourceSelector can also specify names of particular resources of this groupversionkind to backup, using ResourceNames and ResourceNamesRegex It can specify namespaces from which to backup these resources through Namespaces and NamespacesRegex And it can provide a labelSelector to backup resources of this gvk+name+ns combination containing some label For each value that has two fields, for regex and an array of exact names GatherResources performs OR But it performs AND for separate selector types, example: apiversion: v1 kinds: namespaces resourceNamesRegex: "^cattle-|^p-|^c-|^user-|^u-" resourceNames: "local" All namespaces that match resourceNamesRegex, also local ns is backed up
func (*ResourceHandler) WriteBackupObjects ¶
func (h *ResourceHandler) WriteBackupObjects(backupPath string) error
Click to show internal directories.
Click to hide internal directories.