File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
pkg/controller/operators/openshift Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ func NewClusterOperatorReconciler(opts ...ReconcilerOption) (*ClusterOperatorRec
50
50
ReconcilerConfig : config ,
51
51
delayRequeue : reconcile.Result {RequeueAfter : config .RequeueDelay },
52
52
co : co ,
53
- syncTracker : NewSyncTracker (config .SyncCh , co ),
53
+ syncTracker : NewSyncTracker (config .SyncCh , co . DeepCopy () ),
54
54
}
55
55
56
56
var mutations SerialMutations
Original file line number Diff line number Diff line change @@ -5,10 +5,11 @@ import (
5
5
"fmt"
6
6
"sync"
7
7
8
+ configv1 "github.com/openshift/api/config/v1"
8
9
"sigs.k8s.io/controller-runtime/pkg/event"
9
10
)
10
11
11
- func NewSyncTracker (syncCh <- chan error , co * ClusterOperator ) * SyncTracker {
12
+ func NewSyncTracker (syncCh <- chan error , co * configv1. ClusterOperator ) * SyncTracker {
12
13
return & SyncTracker {
13
14
syncCh : syncCh ,
14
15
events : make (chan event.GenericEvent ),
@@ -22,7 +23,7 @@ type SyncTracker struct {
22
23
mutex sync.RWMutex
23
24
once sync.Once
24
25
25
- co * ClusterOperator
26
+ co * configv1. ClusterOperator
26
27
totalSyncs , successfulSyncs int
27
28
}
28
29
Original file line number Diff line number Diff line change 6
6
"testing"
7
7
"testing/quick"
8
8
9
+ configv1 "github.com/openshift/api/config/v1"
9
10
"github.com/stretchr/testify/require"
10
11
"sigs.k8s.io/controller-runtime/pkg/event"
11
12
)
@@ -22,7 +23,7 @@ func TestInvalidFields(t *testing.T) {
22
23
// Add missing fields, then try again
23
24
tracker .syncCh = make (chan error )
24
25
tracker .events = make (chan event.GenericEvent )
25
- tracker .co = & ClusterOperator {}
26
+ tracker .co = & configv1. ClusterOperator {}
26
27
require .NoError (t , tracker .Start (cancelled ))
27
28
}
28
29
@@ -31,7 +32,7 @@ func TestSyncCount(t *testing.T) {
31
32
syncCh := make (chan error )
32
33
defer close (syncCh )
33
34
34
- co := NewClusterOperator ("operator" )
35
+ co := NewClusterOperator ("operator" ). DeepCopy ()
35
36
tracker := NewSyncTracker (syncCh , co )
36
37
37
38
ctx , cancel := context .WithCancel (context .Background ())
You can’t perform that action at this time.
0 commit comments