Documentation
¶
Index ¶
- Constants
- Variables
- func AcquireLease(ctx context.Context, c client.Client, name, namespace, holder string, ...) (*coordv1.Lease, error)
- func AnnotateObject(ctx context.Context, c client.Client, obj client.Object, ...) error
- func DeannotateObject(ctx context.Context, c client.Client, obj client.Object, annotation string) error
- func DeleteIfExists(ctx context.Context, c client.Client, obj client.Object) error
- func GetLease(ctx context.Context, c client.Client, name, namespace string) (*coordv1.Lease, error)
- func GetOperatorNamespace() (string, error)
- func GetWatchNamespace() (string, error)
- func IsLeaseActive(ctx context.Context, c client.Client, name, namespace string) (bool, error)
- func IsPodReady(pod corev1.Pod) bool
- func ReleaseLease(ctx context.Context, c client.Client, name, namespace, holder string) error
- type IsHolderStaleFunc
Constants ¶
View Source
const WatchNamespaceEnvVar = "WATCH_NAMESPACE"
Variables ¶
View Source
var ( ErrNotTheHolder = errors.New("not the holder") ErrLeaseAlreadyHeld = errors.New("lease held by another holder") )
Functions ¶
func AcquireLease ¶ added in v1.20.0
func AnnotateObject ¶ added in v1.16.0
func AnnotateObject(ctx context.Context, c client.Client, obj client.Object, annotations map[string]string) error
AnnotateObject adds the specified annotations to the object
func DeannotateObject ¶ added in v1.16.0
func DeannotateObject(ctx context.Context, c client.Client, obj client.Object, annotation string) error
DeannotateObject removes the specified annotation from the object
func DeleteIfExists ¶ added in v1.23.0
func GetOperatorNamespace ¶ added in v1.14.0
GetOperatorNamespace returns the namespace of the operator pod
func GetWatchNamespace ¶
GetWatchNamespace returns the namespace the operator should be watching for changes
func IsLeaseActive ¶ added in v1.23.0
func IsPodReady ¶ added in v1.21.0
Types ¶
Click to show internal directories.
Click to hide internal directories.