@@ -23,6 +23,7 @@ import (
2323
2424	clustersv1alpha1 "github.com/openmcp-project/openmcp-operator/api/clusters/v1alpha1" 
2525	cconst "github.com/openmcp-project/openmcp-operator/api/clusters/v1alpha1/constants" 
26+ 	apiconst "github.com/openmcp-project/openmcp-operator/api/constants" 
2627	"github.com/openmcp-project/openmcp-operator/internal/config" 
2728)
2829
@@ -87,15 +88,15 @@ func (r *ClusterScheduler) reconcile(ctx context.Context, req reconcile.Request)
8788
8889	// handle operation annotation 
8990	if  cr .GetAnnotations () !=  nil  {
90- 		op , ok  :=  cr .GetAnnotations ()[clustersv1alpha1 .OperationAnnotation ]
91+ 		op , ok  :=  cr .GetAnnotations ()[apiconst .OperationAnnotation ]
9192		if  ok  {
9293			switch  op  {
93- 			case  clustersv1alpha1 .OperationAnnotationValueIgnore :
94+ 			case  apiconst .OperationAnnotationValueIgnore :
9495				log .Info ("Ignoring resource due to ignore operation annotation" )
9596				return  ReconcileResult {}
96- 			case  clustersv1alpha1 .OperationAnnotationValueReconcile :
97+ 			case  apiconst .OperationAnnotationValueReconcile :
9798				log .Debug ("Removing reconcile operation annotation from resource" )
98- 				if  err  :=  ctrlutils .EnsureAnnotation (ctx , r .PlatformCluster .Client (), cr , clustersv1alpha1 .OperationAnnotation , "" , true , ctrlutils .DELETE ); err  !=  nil  {
99+ 				if  err  :=  ctrlutils .EnsureAnnotation (ctx , r .PlatformCluster .Client (), cr , apiconst .OperationAnnotation , "" , true , ctrlutils .DELETE ); err  !=  nil  {
99100					return  ReconcileResult {ReconcileError : errutils .WithReason (fmt .Errorf ("error removing operation annotation: %w" , err ), cconst .ReasonPlatformClusterInteractionProblem )}
100101				}
101102			}
@@ -324,10 +325,10 @@ func (r *ClusterScheduler) SetupWithManager(mgr ctrl.Manager) error {
324325			predicate .Or (
325326				predicate.GenerationChangedPredicate {},
326327				ctrlutils.DeletionTimestampChangedPredicate {},
327- 				ctrlutils .GotAnnotationPredicate (clustersv1alpha1 .OperationAnnotation , clustersv1alpha1 .OperationAnnotationValueReconcile ),
328- 				ctrlutils .LostAnnotationPredicate (clustersv1alpha1 .OperationAnnotation , clustersv1alpha1 .OperationAnnotationValueIgnore ),
328+ 				ctrlutils .GotAnnotationPredicate (apiconst .OperationAnnotation , apiconst .OperationAnnotationValueReconcile ),
329+ 				ctrlutils .LostAnnotationPredicate (apiconst .OperationAnnotation , apiconst .OperationAnnotationValueIgnore ),
329330			),
330- 			predicate .Not (ctrlutils .HasAnnotationPredicate (clustersv1alpha1 .OperationAnnotation , clustersv1alpha1 .OperationAnnotationValueIgnore )),
331+ 			predicate .Not (ctrlutils .HasAnnotationPredicate (apiconst .OperationAnnotation , apiconst .OperationAnnotationValueIgnore )),
331332		)).
332333		Complete (r )
333334}
0 commit comments