utils

package
v2.10.5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyResult added in v2.8.0

func AnyResult(result reconcile.Result, errs ...error) (reconcile.Result, error)

AnyResult returns an error if any given error is not nil, otherwise it just returns the result

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 APIDiscoveryClient added in v2.10.1

type APIDiscoveryClient struct {
	// contains filtered or unexported fields
}

func NewAPIDiscoveryClient added in v2.10.1

func NewAPIDiscoveryClient(conf *rest.Config, fallback *APIVersion) *APIDiscoveryClient

func (*APIDiscoveryClient) HasGroupVersionResource added in v2.10.1

func (ac *APIDiscoveryClient) HasGroupVersionResource(gvr schema.GroupVersionResource) bool

func (*APIDiscoveryClient) ServerVersion added in v2.10.1

func (ac *APIDiscoveryClient) ServerVersion() *APIVersion

type APIVersion added in v2.4.1

type APIVersion struct {
	Major int
	Minor int
}

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