Documentation ¶
Index ¶
- func AddAnnotations(o metav1.Object, annotations map[string]string)
- func AddControllerReference(o metav1.Object, r metav1.OwnerReference) error
- func AddFinalizer(o metav1.Object, finalizer string)
- func AddLabels(o metav1.Object, labels map[string]string)
- func AddOwnerReference(o metav1.Object, r metav1.OwnerReference)
- func AsController(r *corev1.ObjectReference) metav1.OwnerReference
- func AsOwner(r *corev1.ObjectReference) metav1.OwnerReference
- func FinalizerExists(o metav1.Object, finalizer string) bool
- func GVKToString(gvk schema.GroupVersionKind) string
- func GetGVKFromAPIVersionKind(apiVersion, kind string) schema.GroupVersionKind
- func GetGVKFromObject(o client.Object) schema.GroupVersionKind
- func GetGVKfromGVR(c *rest.Config, gvr schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func GetResourcePbGVKFromSchemaGVK(gvk schema.GroupVersionKind) resourcepb.GVK
- func GetResourcePbGVKFromTypeNSN(nsn types.NamespacedName) *resourcepb.NSN
- func GetSchemaGVKFromResourcePbGVK(gvk *resourcepb.GVK) schema.GroupVersionKind
- func GetTypeNSNFromResourcePbNSN(nsn *resourcepb.NSN) types.NamespacedName
- func GetUnstructuredFromGVK(gvk *schema.GroupVersionKind) *unstructured.Unstructured
- func GetUnstructuredListFromGVK(gvk *schema.GroupVersionKind) *unstructured.UnstructuredList
- func HaveSameController(a, b metav1.Object) bool
- func Ignore(is ErrorIs, err error) error
- func IgnoreNotFound(err error) error
- func MarshalData(o *unstructured.Unstructured) (any, error)
- func PointerGVK(gvk schema.GroupVersionKind) *schema.GroupVersionKind
- func PointerResourcePBGVK(gvk resourcepb.GVK) *resourcepb.GVK
- func RemoveAnnotations(o metav1.Object, annotations ...string)
- func RemoveFinalizer(o metav1.Object, finalizer string)
- func RemoveLabels(o metav1.Object, labels ...string)
- func ResourcePbGVKTostring(gvk resourcepb.GVK) string
- func ResourcePbNsnToString(nsn *resourcepb.NSN) string
- func StringToGVK(s string) schema.GroupVersionKind
- func StringToGroupVersionKind(s string) (string, string, string)
- func StringToResourcePbGVK(s string) resourcepb.GVK
- func StringToResourcePbNsn(s string) *resourcepb.NSN
- func TypedReferenceTo(o metav1.Object, of schema.GroupVersionKind) *corev1.ObjectReference
- func WasDeleted(o metav1.Object) bool
- type APIFinalizer
- type APIUpdatingApplicator
- type ApplyOption
- type ErrorIs
- type Finalizer
- type Object
- type OwnerRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddControllerReference ¶
func AddControllerReference(o metav1.Object, r metav1.OwnerReference) error
AddControllerReference to the supplied object's metadata. Any existing owner with the same UID as the supplied reference will be replaced. Returns an error if the supplied object is already controlled by a different owner.
func AddFinalizer ¶
AddFinalizer to the supplied k8s object's metadata.
func AddOwnerReference ¶
func AddOwnerReference(o metav1.Object, r metav1.OwnerReference)
AddOwnerReference to the supplied object' metadata. Any existing owner with the same UID as the supplied reference will be replaced.
func AsController ¶
func AsController(r *corev1.ObjectReference) metav1.OwnerReference
AsController converts the supplied object reference to a controller reference. You may also consider using metav1.NewControllerRef.
func AsOwner ¶
func AsOwner(r *corev1.ObjectReference) metav1.OwnerReference
AsOwner converts the supplied object reference to an owner reference.
func FinalizerExists ¶
FinalizerExists checks whether a certain finalizer is already set on the aupplied object
func GVKToString ¶
func GVKToString(gvk schema.GroupVersionKind) string
func GetGVKFromAPIVersionKind ¶
func GetGVKFromAPIVersionKind(apiVersion, kind string) schema.GroupVersionKind
func GetGVKFromObject ¶
func GetGVKFromObject(o client.Object) schema.GroupVersionKind
func GetGVKfromGVR ¶
func GetGVKfromGVR(c *rest.Config, gvr schema.GroupVersionResource) (schema.GroupVersionKind, error)
func GetResourcePbGVKFromSchemaGVK ¶
func GetResourcePbGVKFromSchemaGVK(gvk schema.GroupVersionKind) resourcepb.GVK
func GetResourcePbGVKFromTypeNSN ¶
func GetResourcePbGVKFromTypeNSN(nsn types.NamespacedName) *resourcepb.NSN
func GetSchemaGVKFromResourcePbGVK ¶
func GetSchemaGVKFromResourcePbGVK(gvk *resourcepb.GVK) schema.GroupVersionKind
func GetTypeNSNFromResourcePbNSN ¶
func GetTypeNSNFromResourcePbNSN(nsn *resourcepb.NSN) types.NamespacedName
func GetUnstructuredFromGVK ¶
func GetUnstructuredFromGVK(gvk *schema.GroupVersionKind) *unstructured.Unstructured
func GetUnstructuredListFromGVK ¶
func GetUnstructuredListFromGVK(gvk *schema.GroupVersionKind) *unstructured.UnstructuredList
func HaveSameController ¶
HaveSameController returns true if both supplied objects are controlled by the same object.
func IgnoreNotFound ¶
IgnoreNotFound returns the supplied error, or nil if the error indicates a Kubernetes resource was not found.
func MarshalData ¶
func MarshalData(o *unstructured.Unstructured) (any, error)
func PointerGVK ¶
func PointerGVK(gvk schema.GroupVersionKind) *schema.GroupVersionKind
func PointerResourcePBGVK ¶
func PointerResourcePBGVK(gvk resourcepb.GVK) *resourcepb.GVK
func RemoveAnnotations ¶
func RemoveFinalizer ¶
RemoveFinalizer from the supplied k8s object's metadata.
func RemoveLabels ¶
func ResourcePbGVKTostring ¶
func ResourcePbGVKTostring(gvk resourcepb.GVK) string
func ResourcePbNsnToString ¶
func ResourcePbNsnToString(nsn *resourcepb.NSN) string
func StringToGVK ¶
func StringToGVK(s string) schema.GroupVersionKind
func StringToResourcePbGVK ¶
func StringToResourcePbGVK(s string) resourcepb.GVK
func StringToResourcePbNsn ¶
func StringToResourcePbNsn(s string) *resourcepb.NSN
func TypedReferenceTo ¶
func TypedReferenceTo(o metav1.Object, of schema.GroupVersionKind) *corev1.ObjectReference
func WasDeleted ¶
Types ¶
type APIFinalizer ¶
type APIFinalizer struct {
// contains filtered or unexported fields
}
An APIFinalizer manages the lifecycle of a finalizer on a k8s object.
func NewAPIFinalizer ¶
func NewAPIFinalizer(c client.Client, finalizer string) *APIFinalizer
NewAPIFinalizer returns a new APIFinalizer.
func (*APIFinalizer) AddFinalizer ¶
func (a *APIFinalizer) AddFinalizer(ctx context.Context, obj Object) error
AddFinalizer to the supplied Managed resource.
func (*APIFinalizer) RemoveFinalizer ¶
func (a *APIFinalizer) RemoveFinalizer(ctx context.Context, obj Object) error
type APIUpdatingApplicator ¶
type APIUpdatingApplicator struct {
// contains filtered or unexported fields
}
An APIUpdatingApplicator applies changes to an object by either creating or updating it in a Kubernetes API server.
func NewAPIUpdatingApplicator ¶
func NewAPIUpdatingApplicator(c client.Client) *APIUpdatingApplicator
NewAPIUpdatingApplicator returns an Applicator that applies changes to an object by either creating or updating it in a Kubernetes API server.
func (*APIUpdatingApplicator) Apply ¶
func (a *APIUpdatingApplicator) Apply(ctx context.Context, o client.Object, ao ...ApplyOption) error
Apply changes to the supplied object. The object will be created if it does not exist, or updated if it does.
type ApplyOption ¶
An ApplyOption is called before patching the current object to match the desired object. ApplyOptions are not called if no current object exists.
type Finalizer ¶
type Finalizer interface { AddFinalizer(ctx context.Context, obj Object) error RemoveFinalizer(ctx context.Context, obj Object) error }
Finalizer manages the lifecycle of the finalizer on a k8s object