mirror of
https://github.com/outbackdingo/kamaji.git
synced 2026-01-27 18:19:25 +00:00
* feat: pausing reconciliation of controlled objects Objects such as TenantControlPlane and Secret can be annotated with kamaji.clastix.io/paused to prevent controllers from processing them. This will stop reconciling objects for debugging or other purposes. Annotation value is irrelevant, just the key presence is evaluated. Signed-off-by: Dario Tranchitella <dario@tranchitella.eu> * docs: pausing reconciliation of controlled objects Signed-off-by: Dario Tranchitella <dario@tranchitella.eu> * chore(logs): typo for deleted resources Signed-off-by: Dario Tranchitella <dario@tranchitella.eu> --------- Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
20 lines
372 B
Go
20 lines
372 B
Go
// Copyright 2022 Clastix Labs
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package utils
|
|
|
|
import (
|
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
|
|
|
"github.com/clastix/kamaji/api/v1alpha1"
|
|
)
|
|
|
|
func IsPaused(obj client.Object) bool {
|
|
if obj.GetAnnotations() == nil {
|
|
return false
|
|
}
|
|
_, paused := obj.GetAnnotations()[v1alpha1.PausedReconciliationAnnotation]
|
|
|
|
return paused
|
|
}
|