utils

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 19 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(defaults map[string]string, 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 APIVersion added in v2.4.1

type APIVersion struct {
	Major int
	Minor int
}

func NewAPIVersionFromConfigWithFallback added in v2.4.1

func NewAPIVersionFromConfigWithFallback(conf *rest.Config, fallback *APIVersion) *APIVersion

func (*APIVersion) Compare added in v2.4.1

func (a *APIVersion) Compare(b *APIVersion) int

func (*APIVersion) String added in v2.4.1

func (a *APIVersion) String() string

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