lockedresource

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

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

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

func GetResources

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 []apis.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

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

GetLockedResourcesFromTemplates Keep backwards compatability with existing consumers

func GetLockedResourcesFromTemplatesWithRestConfig

func GetLockedResourcesFromTemplatesWithRestConfig(resources []apis.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

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