Skip to content

Commit 54b66ca

Browse files
committed
refactor(openshift): use mutator interface directly
Signed-off-by: Nick Hale <[email protected]>
1 parent eb39d10 commit 54b66ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/controller/operators/openshift/clusteroperator_controller.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type ClusterOperatorReconciler struct {
3333
*ReconcilerConfig
3434

3535
delayRequeue reconcile.Result
36-
mutate MutateFunc
36+
mutator Mutator
3737
syncTracker *SyncTracker
3838
co *ClusterOperator
3939
}
@@ -64,7 +64,7 @@ func NewClusterOperatorReconciler(opts ...ReconcilerOption) (*ClusterOperatorRec
6464
MutateFunc(r.setDegraded),
6565
MutateFunc(r.setUpgradeable),
6666
)
67-
r.mutate = mutations.Mutate
67+
r.mutator = mutations
6868

6969
return r, nil
7070
}
@@ -126,6 +126,10 @@ func (r *ClusterOperatorReconciler) Reconcile(ctx context.Context, req reconcile
126126
return res, utilerrors.NewAggregate(errs)
127127
}
128128

129+
func (r *ClusterOperatorReconciler) mutate(ctx context.Context, co *ClusterOperator) error {
130+
return r.mutator.Mutate(ctx, co)
131+
}
132+
129133
func (r *ClusterOperatorReconciler) setVersions(_ context.Context, co *ClusterOperator) error {
130134
// If we've successfully synced, we know our operator is working properly, so we can update the version
131135
if r.syncTracker.SuccessfulSyncs() > 0 && !versionsMatch(co.Status.Versions, r.TargetVersions) {

0 commit comments

Comments
 (0)