k8sutils

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ManagerName = "kubeai-manager"

Variables

This section is empty.

Functions

func DeepHashObject added in v0.7.0

func DeepHashObject(hasher hash.Hash, objectToWrite interface{})

DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes. Copied from k8s.io/kubernetes/pkg/util/hash to avoid dependency on k8s.io/kubernetes.

func DefaultCreateOptions added in v0.6.0

func DefaultCreateOptions() *client.CreateOptions

func DefaultPatchOptions added in v0.6.0

func DefaultPatchOptions() *client.PatchOptions

func DefaultSubResourceUpdateOptions added in v0.6.0

func DefaultSubResourceUpdateOptions() *client.UpdateOptions

func DefaultUpdateOptions added in v0.6.0

func DefaultUpdateOptions() *client.UpdateOptions

func GetAnnotation added in v0.7.0

func GetAnnotation(obj client.Object, key string) string

func GetLabel added in v0.7.0

func GetLabel(obj client.Object, key string) string

func ObjectToGroupKind

func ObjectToGroupKind(s *runtime.Scheme, o client.Object) (schema.GroupKind, error)

func ObjectToGroupVersionKind

func ObjectToGroupVersionKind(s *runtime.Scheme, o client.Object) (schema.GroupVersionKind, error)

func PodHash added in v0.7.0

func PodHash(podSpec corev1.PodSpec) string

PodHash returns a hash value calculated from Pod spec. Inspired by k8s.io/kubernetes/pkg/controller.ComputeHash()

func PodIsReady

func PodIsReady(pod *corev1.Pod) bool

func PodIsScheduled added in v0.7.0

func PodIsScheduled(pod *corev1.Pod) bool

func ServerSideApply

func ServerSideApply(ctx context.Context, cl client.Client, obj client.Object, controllerName string) error

func SetAnnotation added in v0.7.0

func SetAnnotation(obj client.Object, key, value string)

func SetLabel added in v0.7.0

func SetLabel(obj client.Object, key, value string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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