utils

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalLogLevel = 0
View Source
var Log = NewLogger("", os.Stderr, os.Stderr, 0)

Functions

func Contains

func Contains(s []string, e string) bool

Contains check if a string item exists in []string

func DerefOr added in v0.38.0

func DerefOr[T any](p *T, defVal T) T

func DerefOrZero added in v0.38.0

func DerefOrZero[T any](p *T) T

DerefOrZero returns the value referenced by p, or the zero-value of the type

func Hash32

func Hash32(in string) (string, error)

Hash32 calculate for string

func InstallObjectOrder

func InstallObjectOrder() func(o runtime.Object) int

func MergeLabels

func MergeLabels(labelGroups ...map[string]string) map[string]string

MergeLabels merge into map[string]string map

func NewLogger

func NewLogger(name string, out, err io.Writer, level int) logr.Logger

func ObjectKeyFromObjectMeta

func ObjectKeyFromObjectMeta(o v1.Object) types.NamespacedName

func OrderedStringMap

func OrderedStringMap(original map[string]string) *orderedmap.OrderedMap

OrderedStringMap

func UninstallObjectOrder

func UninstallObjectOrder() func(o runtime.Object) int

Types

type ResourceOrder

type ResourceOrder string
const (
	InstallResourceOrder   ResourceOrder = "Install"
	UninstallResourceOrder ResourceOrder = "Uninstall"
)

type ResourceScoreFunc

type ResourceScoreFunc func(o runtime.Object) int

type RuntimeObjects

type RuntimeObjects []runtime.Object

func (RuntimeObjects) Sort

func (os RuntimeObjects) Sort(order ResourceOrder)

Jump to

Keyboard shortcuts

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