helpers

package
v1.9.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains added in v1.9.0

func Contains[T any](array []T, cmp func(v T) bool) bool

func ContainsItem added in v1.9.0

func ContainsItem[T comparable](slice []T, item T) bool

func ConvertSlice added in v1.9.0

func ConvertSlice[To, From any](slice []From, convert func(From) To) []To

func ConvertToArray added in v1.9.0

func ConvertToArray[To, From any](convert func(From) To, objs ...From) []To

func CreateTwoWayMergePatch added in v1.8.0

func CreateTwoWayMergePatch[T runtime.Object](original, modified T) ([]byte, error)

func Filter added in v1.9.0

func Filter[T any](array []T, filterFunc func(T) bool) []T

func FilterOut added in v1.9.0

func FilterOut[T any](array []T, filterOutFunc func(T) bool) []T

func FilterOutNil added in v1.9.0

func FilterOutNil[T any](array []*T) []*T

func GetAgentAuthTokenConfig

func GetAgentAuthTokenConfig(token string) ([]byte, error)

func GetAgentAuthTokenFromAgentConfigSecret

func GetAgentAuthTokenFromAgentConfigSecret(secret *corev1.Secret) (string, error)

func GetAgentAuthTokenFromSecret

func GetAgentAuthTokenFromSecret(secret *corev1.Secret) (string, error)

func IdentityFunc added in v1.9.0

func IdentityFunc[T comparable](item T) func(T) bool

func IsStatusConditionPresentAndEqual added in v1.8.0

func IsStatusConditionPresentAndEqual(conditions []metav1.Condition, conditionType string, status metav1.ConditionStatus, generation int64) bool

func IsStatusConditionPresentAndFalse added in v1.8.0

func IsStatusConditionPresentAndFalse(conditions []metav1.Condition, conditionType string, generation int64) bool

func IsStatusConditionPresentAndTrue added in v1.8.0

func IsStatusConditionPresentAndTrue(conditions []metav1.Condition, conditionType string, generation int64) bool

func IsStatusNodeConfigConditionPresentAndEqual added in v1.9.0

func IsStatusNodeConfigConditionPresentAndEqual(conditions []scyllav1alpha1.NodeConfigCondition, conditionType scyllav1alpha1.NodeConfigConditionType, status corev1.ConditionStatus, generation int64) bool

func IsStatusNodeConfigConditionPresentAndFalse added in v1.9.0

func IsStatusNodeConfigConditionPresentAndFalse(conditions []scyllav1alpha1.NodeConfigCondition, conditionType scyllav1alpha1.NodeConfigConditionType, generation int64) bool

func IsStatusNodeConfigConditionPresentAndTrue added in v1.9.0

func IsStatusNodeConfigConditionPresentAndTrue(conditions []scyllav1alpha1.NodeConfigCondition, conditionType scyllav1alpha1.NodeConfigConditionType, generation int64) bool

func MergeMaps added in v1.8.0

func MergeMaps[Key comparable, Value any](maps ...map[Key]Value) map[Key]Value

MergeMaps merges several maps into a new map. If there are conflicting keys, the last one wins and overwrites the value.

func Must added in v1.8.0

func Must[T any](r T, err error) T

func NormalizeIPs added in v1.8.0

func NormalizeIPs(ips []net.IP) []net.IP

func ParseClusterIP added in v1.8.0

func ParseClusterIP(s string) (net.IP, error)

func ParseClusterIPs added in v1.8.0

func ParseClusterIPs(ipStrings []string) ([]net.IP, error)

func ToArray added in v1.9.0

func ToArray[T any](objs ...T) []T

func UncachedListFunc added in v1.8.0

func UncachedListFunc(f func(options metav1.ListOptions) (runtime.Object, error)) func(options metav1.ListOptions) (runtime.Object, error)

UncachedListFunc wraps a List function and makes sure initial lists avoid watch cache on the apiserver. This is important for caller that need top reason about "happened after" or similar cases.

Types

This section is empty.

Jump to

Keyboard shortcuts

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