Skip to content

Commit 359b3d0

Browse files
committed
Post-bump fixes
1 parent 651034a commit 359b3d0

18 files changed

+180
-86
lines changed

pkg/operator/bootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ func (c *Controller) Bootstrap() error {
8080
OperatorSpec: operatorapi.OperatorSpec{
8181
LogLevel: operatorapi.Normal,
8282
OperatorLogLevel: operatorapi.Normal,
83+
ManagementState: mgmtState,
8384
},
84-
ManagementState: mgmtState,
8585
Storage: platformStorage,
8686
Replicas: replicas,
8787
RolloutStrategy: string(rolloutStrategy),

pkg/operator/bootstrap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ func TestBootstrapAWS(t *testing.T) {
7171
}
7272

7373
expected := imageregistryv1.ImageRegistrySpec{
74-
ManagementState: "Managed",
7574
Storage: imageregistryv1.ImageRegistryConfigStorage{
7675
S3: &imageregistryv1.ImageRegistryConfigStorageS3{},
7776
},
7877
OperatorSpec: operatorv1.OperatorSpec{
78+
ManagementState: "Managed",
7979
LogLevel: operatorv1.Normal,
8080
OperatorLogLevel: operatorv1.Normal,
8181
},

pkg/operator/status_test.go

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ func Test_syncStatus(t *testing.T) {
5959
name: "set as Removed but still with Deployment in place",
6060
cfg: &imageregistryv1.Config{
6161
Spec: imageregistryv1.ImageRegistrySpec{
62-
ManagementState: "Removed",
62+
OperatorSpec: operatorv1.OperatorSpec{
63+
ManagementState: "Removed",
64+
},
6365
},
6466
},
6567
deploy: &appsapi.Deployment{
@@ -107,7 +109,9 @@ func Test_syncStatus(t *testing.T) {
107109
name: "everything online and working as expected",
108110
cfg: &imageregistryv1.Config{
109111
Spec: imageregistryv1.ImageRegistrySpec{
110-
ManagementState: "Managed",
112+
OperatorSpec: operatorv1.OperatorSpec{
113+
ManagementState: "Managed",
114+
},
111115
},
112116
},
113117
deploy: &appsapi.Deployment{
@@ -195,7 +199,9 @@ func Test_syncStatus(t *testing.T) {
195199
name: "Deployment lagging some replicas",
196200
cfg: &imageregistryv1.Config{
197201
Spec: imageregistryv1.ImageRegistrySpec{
198-
ManagementState: "Managed",
202+
OperatorSpec: operatorv1.OperatorSpec{
203+
ManagementState: "Managed",
204+
},
199205
},
200206
},
201207
deploy: &appsapi.Deployment{
@@ -237,7 +243,9 @@ func Test_syncStatus(t *testing.T) {
237243
name: "Deployment lagging some replicas (progressing with random reason)",
238244
cfg: &imageregistryv1.Config{
239245
Spec: imageregistryv1.ImageRegistrySpec{
240-
ManagementState: "Managed",
246+
OperatorSpec: operatorv1.OperatorSpec{
247+
ManagementState: "Managed",
248+
},
241249
},
242250
},
243251
deploy: &appsapi.Deployment{
@@ -286,7 +294,9 @@ func Test_syncStatus(t *testing.T) {
286294
name: "Deployment lagging some replicas (progressing with ProgressDeadlineExceeded reason)",
287295
cfg: &imageregistryv1.Config{
288296
Spec: imageregistryv1.ImageRegistrySpec{
289-
ManagementState: "Managed",
297+
OperatorSpec: operatorv1.OperatorSpec{
298+
ManagementState: "Managed",
299+
},
290300
},
291301
},
292302
deploy: &appsapi.Deployment{
@@ -340,7 +350,9 @@ func Test_syncStatus(t *testing.T) {
340350
name: "Deployment without replicas for more than one minute",
341351
cfg: &imageregistryv1.Config{
342352
Spec: imageregistryv1.ImageRegistrySpec{
343-
ManagementState: "Managed",
353+
OperatorSpec: operatorv1.OperatorSpec{
354+
ManagementState: "Managed",
355+
},
344356
},
345357
Status: imageregistryv1.ImageRegistryStatus{
346358
OperatorStatus: operatorv1.OperatorStatus{
@@ -386,7 +398,9 @@ func Test_syncStatus(t *testing.T) {
386398
name: "Deployment without available replicas",
387399
cfg: &imageregistryv1.Config{
388400
Spec: imageregistryv1.ImageRegistrySpec{
389-
ManagementState: "Managed",
401+
OperatorSpec: operatorv1.OperatorSpec{
402+
ManagementState: "Managed",
403+
},
390404
},
391405
},
392406
deploy: &appsapi.Deployment{},
@@ -421,7 +435,9 @@ func Test_syncStatus(t *testing.T) {
421435
name: "Deployment flagged to be deleted",
422436
cfg: &imageregistryv1.Config{
423437
Spec: imageregistryv1.ImageRegistrySpec{
424-
ManagementState: "Managed",
438+
OperatorSpec: operatorv1.OperatorSpec{
439+
ManagementState: "Managed",
440+
},
425441
},
426442
},
427443
deploy: &appsapi.Deployment{
@@ -460,7 +476,9 @@ func Test_syncStatus(t *testing.T) {
460476
name: "set as Removed without Deployment in place",
461477
cfg: &imageregistryv1.Config{
462478
Spec: imageregistryv1.ImageRegistrySpec{
463-
ManagementState: "Removed",
479+
OperatorSpec: operatorv1.OperatorSpec{
480+
ManagementState: "Removed",
481+
},
464482
},
465483
},
466484
expectedConditions: []operatorv1.OperatorCondition{
@@ -494,7 +512,9 @@ func Test_syncStatus(t *testing.T) {
494512
name: "permanent error without Deployment in place",
495513
cfg: &imageregistryv1.Config{
496514
Spec: imageregistryv1.ImageRegistrySpec{
497-
ManagementState: "Managed",
515+
OperatorSpec: operatorv1.OperatorSpec{
516+
ManagementState: "Managed",
517+
},
498518
},
499519
},
500520
applyError: newPermanentError("Permanent", fmt.Errorf("segfault")),
@@ -529,7 +549,9 @@ func Test_syncStatus(t *testing.T) {
529549
name: "Deployment not in place after one minute",
530550
cfg: &imageregistryv1.Config{
531551
Spec: imageregistryv1.ImageRegistrySpec{
532-
ManagementState: "Managed",
552+
OperatorSpec: operatorv1.OperatorSpec{
553+
ManagementState: "Managed",
554+
},
533555
},
534556
Status: imageregistryv1.ImageRegistryStatus{
535557
OperatorStatus: operatorv1.OperatorStatus{
@@ -575,7 +597,9 @@ func Test_syncStatus(t *testing.T) {
575597
name: "generic error without Deployment in place",
576598
cfg: &imageregistryv1.Config{
577599
Spec: imageregistryv1.ImageRegistrySpec{
578-
ManagementState: "Managed",
600+
OperatorSpec: operatorv1.OperatorSpec{
601+
ManagementState: "Managed",
602+
},
579603
},
580604
},
581605
applyError: fmt.Errorf("error creating deployment"),
@@ -611,7 +635,9 @@ func Test_syncStatus(t *testing.T) {
611635
deploy: &appsapi.Deployment{},
612636
cfg: &imageregistryv1.Config{
613637
Spec: imageregistryv1.ImageRegistrySpec{
614-
ManagementState: "Unmanaged",
638+
OperatorSpec: operatorv1.OperatorSpec{
639+
ManagementState: "Unmanaged",
640+
},
615641
},
616642
},
617643
expectedConditions: []operatorv1.OperatorCondition{
@@ -645,7 +671,9 @@ func Test_syncStatus(t *testing.T) {
645671
name: "set as Managed without Deployment in place",
646672
cfg: &imageregistryv1.Config{
647673
Spec: imageregistryv1.ImageRegistrySpec{
648-
ManagementState: "Managed",
674+
OperatorSpec: operatorv1.OperatorSpec{
675+
ManagementState: "Managed",
676+
},
649677
},
650678
},
651679
expectedConditions: []operatorv1.OperatorCondition{
@@ -679,7 +707,9 @@ func Test_syncStatus(t *testing.T) {
679707
name: "a faulty route",
680708
cfg: &imageregistryv1.Config{
681709
Spec: imageregistryv1.ImageRegistrySpec{
682-
ManagementState: "Managed",
710+
OperatorSpec: operatorv1.OperatorSpec{
711+
ManagementState: "Managed",
712+
},
683713
},
684714
},
685715
deploy: &appsapi.Deployment{

pkg/resource/clusteroperator_test.go

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
cfgapi "github.com/openshift/api/config/v1"
1414
imregv1 "github.com/openshift/api/imageregistry/v1"
15-
operatorapi "github.com/openshift/api/operator/v1"
15+
operatorv1 "github.com/openshift/api/operator/v1"
1616

1717
"github.com/openshift/cluster-image-registry-operator/pkg/defaults"
1818
)
@@ -78,7 +78,9 @@ func TestSyncVersions(t *testing.T) {
7878
failOnGet: true,
7979
config: &imregv1.Config{
8080
Spec: imregv1.ImageRegistrySpec{
81-
ManagementState: operatorapi.Managed,
81+
OperatorSpec: operatorv1.OperatorSpec{
82+
ManagementState: operatorv1.Managed,
83+
},
8284
},
8385
},
8486
},
@@ -88,7 +90,9 @@ func TestSyncVersions(t *testing.T) {
8890
expectsError: false,
8991
config: &imregv1.Config{
9092
Spec: imregv1.ImageRegistrySpec{
91-
ManagementState: operatorapi.Managed,
93+
OperatorSpec: operatorv1.OperatorSpec{
94+
ManagementState: operatorv1.Managed,
95+
},
9296
},
9397
},
9498
},
@@ -107,7 +111,9 @@ func TestSyncVersions(t *testing.T) {
107111
},
108112
config: &imregv1.Config{
109113
Spec: imregv1.ImageRegistrySpec{
110-
ManagementState: operatorapi.Managed,
114+
OperatorSpec: operatorv1.OperatorSpec{
115+
ManagementState: operatorv1.Managed,
116+
},
111117
},
112118
},
113119
},
@@ -138,7 +144,9 @@ func TestSyncVersions(t *testing.T) {
138144
},
139145
config: &imregv1.Config{
140146
Spec: imregv1.ImageRegistrySpec{
141-
ManagementState: operatorapi.Managed,
147+
OperatorSpec: operatorv1.OperatorSpec{
148+
ManagementState: operatorv1.Managed,
149+
},
142150
},
143151
},
144152
},
@@ -169,7 +177,9 @@ func TestSyncVersions(t *testing.T) {
169177
},
170178
config: &imregv1.Config{
171179
Spec: imregv1.ImageRegistrySpec{
172-
ManagementState: operatorapi.Managed,
180+
OperatorSpec: operatorv1.OperatorSpec{
181+
ManagementState: operatorv1.Managed,
182+
},
173183
},
174184
},
175185
},
@@ -200,7 +210,9 @@ func TestSyncVersions(t *testing.T) {
200210
},
201211
config: &imregv1.Config{
202212
Spec: imregv1.ImageRegistrySpec{
203-
ManagementState: operatorapi.Removed,
213+
OperatorSpec: operatorv1.OperatorSpec{
214+
ManagementState: operatorv1.Removed,
215+
},
204216
},
205217
},
206218
},
@@ -231,7 +243,9 @@ func TestSyncVersions(t *testing.T) {
231243
},
232244
config: &imregv1.Config{
233245
Spec: imregv1.ImageRegistrySpec{
234-
ManagementState: operatorapi.Unmanaged,
246+
OperatorSpec: operatorv1.OperatorSpec{
247+
ManagementState: operatorv1.Unmanaged,
248+
},
235249
},
236250
},
237251
},

0 commit comments

Comments
 (0)