Skip to content

Commit 964c0ee

Browse files
authored
Skip reconciling CRs for operators marked as no-op (#1001)
Signed-off-by: Daniel Fan <[email protected]>
1 parent f5da287 commit 964c0ee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

controllers/operandrequest/reconcile_operand.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
olmv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
3232
"github.com/pkg/errors"
3333
authorizationv1 "k8s.io/api/authorization/v1"
34+
corev1 "k8s.io/api/core/v1"
3435
apierrors "k8s.io/apimachinery/pkg/api/errors"
3536
"k8s.io/apimachinery/pkg/api/meta"
3637
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -78,6 +79,12 @@ func (r *Reconciler) reconcileOperand(ctx context.Context, requestInstance *oper
7879
continue
7980
}
8081

82+
if opdRegistry.InstallMode == operatorv1alpha1.InstallModeNoop {
83+
requestInstance.SetNoSuitableRegistryCondition(registryKey.String(), opdRegistry.Name+" is in maintenance status", operatorv1alpha1.ResourceTypeOperandRegistry, corev1.ConditionTrue, &r.Mutex)
84+
requestInstance.SetMemberStatus(operand.Name, operatorv1alpha1.OperatorRunning, operatorv1alpha1.ServiceRunning, &r.Mutex)
85+
continue
86+
}
87+
8188
operatorName := opdRegistry.Name
8289

8390
klog.V(3).Info("Looking for csv for the operator: ", operatorName)

0 commit comments

Comments
 (0)