lockedresource

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 15 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultExcludedPaths = []string{".metadata", ".status", ".spec.replicas"}

DefaultExcludedPaths represents paths that are exlcuded by default in all resources

View Source
var DefaultExcludedPathsSet = strset.New(DefaultExcludedPaths...)

DefaultExcludedPathsSet represents paths that are exlcuded by default in all resources

Functions

func AsListOfUnstructured

func AsListOfUnstructured(lockedResources []LockedResource) []unstructured.Unstructured

AsListOfUnstructured given a list of LockedResource, returns a list of unstructured.Unstructured

func FilterOutPaths added in v0.2.5

func FilterOutPaths(obj *unstructured.Unstructured, jsonPaths []string) (*unstructured.Unstructured, error)

func GetResources added in v0.2.1

func GetResources(lockedResources []LockedResource) []client.Object

GetResources returs an arrays of apis.Resources from an arya of LockedResources, useful for mass operations on the LockedResources

Types

type LockedResource

type LockedResource struct {
	// unstructured.Unstructured is the resource to be locked
	unstructured.Unstructured `json:"usntructured,omitempty"`
	// ExcludedPaths are the jsonPaths to be excluded when consider whether the resource has changed
	ExcludedPaths []string `json:"excludedPaths,omitempty"`
}

LockedResource represents a resource to be locked down by a LockedResourceReconciler within a LockedResourceManager

func GetLockedResources

func GetLockedResources(resources []utilsapi.LockedResource) ([]LockedResource, error)

GetLockedResources turns an array of Resources as read from an API into an array of LockedResources, usable by the LockedResourceManager

func GetLockedResourcesFromTemplates added in v0.2.1

func GetLockedResourcesFromTemplates(resources []utilsapi.LockedResourceTemplate, params interface{}) ([]LockedResource, error)

GetLockedResourcesFromTemplates Keep backwards compatability with existing consumers

func GetLockedResourcesFromTemplatesWithRestConfig added in v0.3.5

func GetLockedResourcesFromTemplatesWithRestConfig(resources []utilsapi.LockedResourceTemplate, config *rest.Config, params interface{}) ([]LockedResource, error)

GetLockedResourcesFromTemplatesWithRestConfig turns an array of ResourceTemplates as read from an API into an array of LockedResources using a params to process the templates

func (*LockedResource) GetKey

func (lr *LockedResource) GetKey() string

GetKey returns the marshalled resource

type Patch added in v0.2.5

type Patch struct {
	Operation string `json:"op"`
	Path      string `json:"path"`
}

Patch represents a patch operation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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