util

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyJSONMergePatch

func ApplyJSONMergePatch(original, patch []byte) ([]byte, error)

ApplyJSONMergePatch applies JSON merge patch onto the original document

func ApplyStrategicMergePatch

func ApplyStrategicMergePatch(gvk schema.GroupVersionKind, original, patch []byte) ([]byte, error)

ApplyStrategicMergePatch applies strategic merge patch on original

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString checks if string exists in slice

func CreateJSONMergePatch

func CreateJSONMergePatch(original, current, modified []byte) ([]byte, error)

CreateJSONMergePatch creates JSON merge patch between original, current and modified

func CreateStrategicMergePatch

func CreateStrategicMergePatch(gvk schema.GroupVersionKind, original, current, modified []byte) ([]byte, error)

CreateStrategicMergePatch creates strategic merge patch for original and modified

func GetGVK

func GetGVK(b []byte) (*schema.GroupVersionKind, error)

GetGVK returns GroupVersionKind of json serialized k8s object

func IsStrategicMergePatch

func IsStrategicMergePatch(gvk schema.GroupVersionKind) bool

IsStrategicMergePatch returns true if gvk is present in the registered scheme

func KnownObject

func KnownObject(gvk schema.GroupVersionKind) bool

KnownObject returns true if the object GVK is in scheme

func NewObject

func NewObject(gvk schema.GroupVersionKind) (o client.Object, err error)

NewObject returns new object of given GVK

func OwnsObject

func OwnsObject(owner, object metav1.Object) bool

OwnsObject checks if the object is owned by the owner

func RemoveString

func RemoveString(slice []string, s string) (result []string)

RemoveString removes string from slick

func SetNamespace

func SetNamespace(so *clusterv2.StepObject, namespace string) error

SetNamespace is a utility function setting namespace for a step objects it preserves namespace if already set for selective resources

func SetOwnerReference

func SetOwnerReference(owner, object metav1.Object) error

SetOwnerReference sets owner reference for objects controlled by paralus cluster controllers

Types

This section is empty.

Jump to

Keyboard shortcuts

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