Documentation
¶
Index ¶
- func FromUnstructured(in unstructured.Unstructured, out client.Object) error
- func GatewaysSliceToAnnotation(gateways []gwtypes.Gateway) string
- func Hash32(obj any) string
- func Hash64(obj any) string
- func KeepProgrammed(objs []unstructured.Unstructured) []unstructured.Unstructured
- func KeepYoungest(objs []unstructured.Unstructured) []unstructured.Unstructured
- func SetMetadata(owner, obj client.Object, hashSpec string, routeAnnotation string, ...) error
- func ToUnstructured(obj client.Object, scheme *runtime.Scheme) (unstructured.Unstructured, error)
- type ReduceFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromUnstructured ¶
func FromUnstructured(in unstructured.Unstructured, out client.Object) error
FromUnstructured converts an unstructured.Unstructured object to a typed client.Object. It returns an error if the conversion fails.
func GatewaysSliceToAnnotation ¶
GatewaysSliceToAnnotation converts a slice of Gateway objects to a comma-separated string in the format "namespace/name,namespace/name,..."
func KeepProgrammed ¶
func KeepProgrammed(objs []unstructured.Unstructured) []unstructured.Unstructured
KeepProgrammed filters the given slice of unstructured.Unstructured objects, returning only those that are not in the "Programmed" condition. If all objects are programmed, it returns the original slice.
func KeepYoungest ¶
func KeepYoungest(objs []unstructured.Unstructured) []unstructured.Unstructured
KeepYoungest returns a new slice with all elements except the youngest (most recently created) object removed from the input slice. If the input slice is empty, it returns nil.
func SetMetadata ¶
func SetMetadata(owner, obj client.Object, hashSpec string, routeAnnotation string, gatewaysAnnotation string) error
SetMetadata sets the metadata for the given Object
func ToUnstructured ¶
func ToUnstructured(obj client.Object, scheme *runtime.Scheme) (unstructured.Unstructured, error)
ToUnstructured converts a client.Object to an unstructured.Unstructured object. It infers TypeMeta using the provided scheme if not set. Returns the unstructured object and any error encountered during conversion.
Types ¶
type ReduceFunc ¶
type ReduceFunc func([]unstructured.Unstructured) []unstructured.Unstructured
ReduceFunc defines a function type that takes a slice of unstructured.Unstructured objects and returns a (possibly modified or filtered) slice of unstructured.Unstructured objects.