Help us shape the future of Go! Take the 2026 Go Developer Survey

object

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckOwnerRefExist

func CheckOwnerRefExist(
	uid types.UID,
	ownerRefs []metav1.OwnerReference,
) bool

CheckOwnerRefExist - returns true if the owner is already in the owner ref list

func EnsureOwnerRef

func EnsureOwnerRef(
	ctx context.Context,
	h *helper.Helper,
	owner client.Object,
	object client.Object,
) error

EnsureOwnerRef - adds owner ref (no controller) to an object which then can can be used to reconcile when the object changes by adding the following in NewControllerManagedBy(). Note: This will not triggere a reconcilation when the object gets re-created from scratch, like deleting a secret.

watch for secrets we added ourselves as additional owners, NOT as controller Watches(

&source.Kind{Type: &corev1.Secret{}},
&handler.EnqueueRequestForOwner{OwnerType: &clientv1.OpenStackClient{}, IsController: false}).

func PatchOwnerRef

func PatchOwnerRef(
	owner client.Object,
	object client.Object,
	scheme *runtime.Scheme,
) (map[string]interface{}, client.Patch, error)

PatchOwnerRef - creates a patch to add ownerref to an object

Types

This section is empty.

Jump to

Keyboard shortcuts

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