Documentation ¶
Index ¶
- Constants
- func CompareHostnamesSpecificity(hostname1, hostname2 string) bool
- func Filter[T any](slice []T, f func(T) bool) []T
- func Find[T any](slice []T, match func(T) bool) (*T, bool)
- func GetClusterUID(ctx context.Context, c dynamic.Interface) (string, error)
- func GetEmptySliceIfNil[T any](val []T) []T
- func Index[T any](slice []T, match func(T) bool) int
- func IsCRDInstalled(restMapper meta.RESTMapper, group, kind, version string) (bool, error)
- func IsObjectTaggedToDelete(obj client.Object) bool
- func IsOwnedBy(owned, owner client.Object) bool
- func Map[T, U any](slice []T, f func(T) U) []U
- func TagObjectToDelete(obj client.Object)
- func ToBase36Hash(s string) string
- func ToBase36HashLen(s string, l int) string
- type Name
Constants ¶
const ( DeleteTagAnnotation = "kuadrant.io/delete" ClusterIDLength = 6 )
Variables ¶
This section is empty.
Functions ¶
func CompareHostnamesSpecificity ¶
CompareHostnamesSpecificity returns true if hostname1 is more specific than hostname2
func Filter ¶
Filter filters the input slice using the given predicate function and returns a new slice with the results.
func GetEmptySliceIfNil ¶
func GetEmptySliceIfNil[T any](val []T) []T
GetEmptySliceIfNil returns a provided slice, or an empty slice of the same type if the input slice is nil.
func IsCRDInstalled ¶
func IsCRDInstalled(restMapper meta.RESTMapper, group, kind, version string) (bool, error)
func IsObjectTaggedToDelete ¶
IsObjectTaggedToDelete checks if the given object is tagged for deletion. It looks for the DeleteTagAnnotation in the object's annotations and returns true if the annotation value is set to "true", false otherwise.
func IsOwnedBy ¶
IsOwnedBy checks if the provided owned object is owned by the given owner object. Ownership is determined based on matching the owner reference's group, kind, and name. The version of the owner reference is not checked in this implementation. Returns true if the owned object is owned by the owner object, false otherwise.
func Map ¶
func Map[T, U any](slice []T, f func(T) U) []U
Map applies the given mapper function to each element in the input slice and returns a new slice with the results.
func TagObjectToDelete ¶
TagObjectToDelete adds a special DeleteTagAnnotation to the object's annotations. If the object's annotations are nil, it first initializes the Annotations field with an empty map.
func ToBase36Hash ¶
func ToBase36HashLen ¶
Types ¶
type Name ¶
type Name string
Name describes a (possibly wildcarded) hostname