Documentation ¶
Overview ¶
Package util contains utility functions used by other packages
Index ¶
- func ContainsBy[T any](collection []T, predicate func(item T) bool) bool
- func ConvertStringSlice[T1 ~string, T2 ~string](collection []T1) []T2
- func GetItems(list client.ObjectList) []client.Object
- func Hash(o interface{}) string
- func IgnoreProperty(p string) cmp.Option
- func IsBeingDeleted(o client.Object) bool
- func MergeMaps(base map[string]string, merges ...map[string]string) map[string]string
- func NewObjectFromGVK(gvk schema.GroupVersionKind, s *runtime.Scheme) (client.Object, error)
- func NewObjectListFromGVK(gvk schema.GroupVersionKind, s *runtime.Scheme) (client.ObjectList, error)
- func ObjectKey(o client.Object) types.NamespacedName
- func ObjectReference(o client.Object, gvk schema.GroupVersionKind) *corev1.ObjectReference
- func Pointer[T any](t T) *T
- func ResourceDefaulter(o Defaulter) func(context.Context, client.Client, client.Object) error
- func SetTypeMeta(o client.Object, gvk schema.GroupVersionKind) client.Object
- type Defaulter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsBy ¶ added in v0.4.0
func ConvertStringSlice ¶ added in v0.4.0
func GetItems ¶
func GetItems(list client.ObjectList) []client.Object
this is an ugly function to retrieve the list of Items from a client.ObjectList because the interface doesn't have a GetItems method
func IgnoreProperty ¶ added in v0.4.0
func IsBeingDeleted ¶
func NewObjectFromGVK ¶ added in v0.4.0
func NewObjectListFromGVK ¶ added in v0.4.0
func NewObjectListFromGVK(gvk schema.GroupVersionKind, s *runtime.Scheme) (client.ObjectList, error)
func ObjectReference ¶ added in v0.4.0
func ObjectReference(o client.Object, gvk schema.GroupVersionKind) *corev1.ObjectReference
func ResourceDefaulter ¶ added in v0.4.0
func SetTypeMeta ¶ added in v0.5.1
Types ¶
Click to show internal directories.
Click to hide internal directories.