Documentation
¶
Index ¶
- Constants
- func BoolPtr(v bool) *bool
- func ContainsElement[T comparable](slice []T, element T) bool
- func GetFilesWithSuffix(baseDir string, suffixes ...string) ([]string, error)
- func GetResourceHash(obj client.Object) string
- func GetStringHash(s string) string
- func IsEqual[T client.Object](existing, desired T, fieldsToCompare ...string) bool
- func IsSpecChanged(current client.Object, desired client.Object) bool
- func MergeEnvVars(env1, env2 []corev1.EnvVar) []corev1.EnvVar
- func MergeMaps(m1, m2 map[string]string) map[string]string
- func SortHPAMetricsSpec(metrics []autoscalingv2.MetricSpec) []autoscalingv2.MetricSpec
- func SortKeys(obj interface{}) interface{}
Constants ¶
View Source
const (
// NvidiaAnnotationHashKey indicates annotation name for last applied hash by the operator
NvidiaAnnotationHashKey = "nvidia.com/last-applied-hash"
)
Variables ¶
This section is empty.
Functions ¶
func ContainsElement ¶
func ContainsElement[T comparable](slice []T, element T) bool
ContainsElement checks if an element exists in a slice
func GetFilesWithSuffix ¶
GetFilesWithSuffix returns all files under a given base directory that have a specific suffix The operation is performed recursively on subdirectories as well
func GetResourceHash ¶
GetResourceHash returns a consistent hash for the given object spec
func GetStringHash ¶
func IsSpecChanged ¶
IsSpecChanged returns true if the spec has changed between the existing one and the new resource spec compared by hash.
func MergeEnvVars ¶
MergeEnvVars merges two slices of environment variables, giving precedence to the second slice in case of duplicates
func SortHPAMetricsSpec ¶
func SortHPAMetricsSpec(metrics []autoscalingv2.MetricSpec) []autoscalingv2.MetricSpec
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.