apiutils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDependent

func AddDependent(o metav1.Object, newDependent string) (bool, error)

func DeleteAndGarbageCollect

func DeleteAndGarbageCollect(ctx context.Context, c client.Client, o client.Object, dependent string) error

func EscapeIP

func EscapeIP(ip commonv1alpha1.IP) string

func EscapePrefix

func EscapePrefix(prefix commonv1alpha1.IPPrefix) string

func FilterObjectListByDependent

func FilterObjectListByDependent[S ~[]Obj, ObjPtr interface {
	client.Object
	*Obj
}, Obj any](objs S, dependent string) ([]Obj, error)

func GetAnnotationsAnnotation

func GetAnnotationsAnnotation(o metav1.Object) (map[string]string, error)

func GetDependents

func GetDependents(o metav1.Object) ([]string, error)

func GetIPLabel

func GetIPLabel(o metav1.Object) (commonv1alpha1.IP, error)

func GetLabelsAnnotation

func GetLabelsAnnotation(o metav1.Object) (map[string]string, error)

func GetObjectMetadata

func GetObjectMetadata(o metav1.Object) (*orimeta.ObjectMetadata, error)

func GetPrefixLabel

func GetPrefixLabel(o metav1.Object) (commonv1alpha1.IPPrefix, error)

func GetPurpose

func GetPurpose(o metav1.Object) string

func HasDependent

func HasDependent(obj client.Object, dependent string) (bool, error)

func IsCreated

func IsCreated(o metav1.Object) bool

func IsManagedBy

func IsManagedBy(o metav1.Object, manager string) bool

func PatchControlledBy

func PatchControlledBy(ctx context.Context, c client.Client, owner, controlled client.Object) error

func PatchCreated

func PatchCreated(ctx context.Context, c client.Client, o client.Object) error

func PatchCreatedWithDependent

func PatchCreatedWithDependent(ctx context.Context, c client.Client, o client.Object, dependent string) error

func PatchOwnedBy

func PatchOwnedBy(ctx context.Context, c client.Client, owner, obj client.Object) error

func RemoveDependent

func RemoveDependent(o metav1.Object, removeDependent string) (bool, error)

func SetAnnotationsAnnotation

func SetAnnotationsAnnotation(o metav1.Object, annotations map[string]string) error

func SetCreatedLabel

func SetCreatedLabel(o metav1.Object)

func SetDependents

func SetDependents(o metav1.Object, dependents []string) error

func SetIPLabel

func SetIPLabel(o metav1.Object, ip commonv1alpha1.IP)

func SetLabelsAnnotation

func SetLabelsAnnotation(o metav1.Object, labels map[string]string) error

func SetLoadBalancerTypeLabel added in v0.1.1

func SetLoadBalancerTypeLabel(o metav1.Object, typ networkingv1alpha1.LoadBalancerType)

func SetManagerLabel

func SetManagerLabel(o metav1.Object, manager string)

func SetNetworkHandleLabel added in v0.1.1

func SetNetworkHandleLabel(o metav1.Object, handle string)

func SetObjectMetadata

func SetObjectMetadata(o metav1.Object, metadata *orimeta.ObjectMetadata) error

func SetPrefixLabel

func SetPrefixLabel(o metav1.Object, prefix commonv1alpha1.IPPrefix)

func SetPurpose

func SetPurpose(o metav1.Object, purpose string)

func UnescapeIP

func UnescapeIP(escaped string) (commonv1alpha1.IP, error)

func UnescapePrefix

func UnescapePrefix(escapedPrefix string) (commonv1alpha1.IPPrefix, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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