utils

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyError

func AnyError(errs ...error) error

AnyError returns an error if any given error is not nil.

func MakeKustPatches

func MakeKustPatches(patches ...piraeusiov1.Patch) []kusttypes.Patch

func PruneResources

func PruneResources(ctx context.Context, cl client.Client, controller client.Object, namespace string, toKeep resmap.ResMap, kindsToPrune ...client.Object) error

PruneResources removes all resources that are controlled by the given controller, but that should (no longer) exist.

func RenderPatches

func RenderPatches(params map[string]any, patches ...kusttypes.Patch) ([]kusttypes.Patch, error)

func ResolveClusterProperties

func ResolveClusterProperties(props ...v1.LinstorControllerProperty) map[string]string

func ResolveNodeProperties

func ResolveNodeProperties(node *corev1.Node, props ...v1.LinstorNodeProperty) (map[string]string, error)

func ToEncodedPatch

func ToEncodedPatch(target *kusttypes.Selector, patch any) (*kusttypes.Patch, error)

Types

type JsonPatch

type JsonPatch struct {
	Op    Op     `json:"op"`
	Path  string `json:"path"`
	From  string `json:"from,omitempty"`
	Value any    `json:"value,omitempty"`
}

type Op

type Op string
const (
	Add     Op = "add"
	Remove  Op = "remove"
	Replace Op = "replace"
	Move    Op = "move"
	Copy    Op = "copy"
	Test    Op = "test"
)

Directories

Path Synopsis
Package fieldpath supplies methods for extracting fields from objects given a path to a field.
Package fieldpath supplies methods for extracting fields from objects given a path to a field.

Jump to

Keyboard shortcuts

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