lockedresource

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 12 Imported by: 4 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 []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 added in v0.2.1

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

GetLockedResourcesFromTemplates Keep backwards compatability with existing consumers

func GetLockedResourcesFromTemplatesWithRestConfig added in v0.3.5

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 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