utils

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Digest32

func Digest32(str string) string

Digest32 returns a 32-bit hash of the input string. The hash is represented as a hexadecimal string of length 8.

func Digest256

func Digest256(str string) string

Digest256 returns a sha256 hash of the input string. The hash is represented as a hexadecimal string of length 64.

func GetHashedName

func GetHashedName(nsName string, length int) string

GetHashedName returns a partially hashed name for the string including up to the given length of the original name characters before the hash. Input `nsName` should be formatted as `{Namespace}/{ResourceName}`.

func Merge added in v1.4.0

func Merge[T any](original, patch T, mergeType egv1a1.MergeType) (T, error)

func MergeWithPatch added in v1.4.0

func MergeWithPatch[T any](original T, patch *egv1a1.KubernetesPatchSpec, disabled bool) (T, error)

MergeWithPatch merges patch onto original. If disabled is true, patch is ignored and original is returned unchanged, regardless of patch's content.

func NamespacedName

func NamespacedName(obj client.Object) types.NamespacedName

NamespacedName creates and returns object's NamespacedName.

Types

type NamespacedNameWithGroupKind added in v1.0.2

type NamespacedNameWithGroupKind struct {
	types.NamespacedName
	schema.GroupKind
}

func GetNamespacedNameWithGroupKind added in v1.0.2

func GetNamespacedNameWithGroupKind(obj client.Object) NamespacedNameWithGroupKind

GetNamespacedNameWithGroupKind creates and returns object's NamespacedNameWithGroupKind.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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