@@ -27,7 +27,7 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) {
2727 fields : fields {
2828 TypeMeta : v1.TypeMeta {},
2929 ObjectMeta : v1.ObjectMeta {},
30- Spec : json .RawMessage (`
30+ Spec : json .RawMessage (`
3131 {
3232 "apiservicedefinitions": {
3333 "owned": [
@@ -41,18 +41,18 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) {
4141 },
4242 wantOwned : []* DefinitionKey {
4343 {
44- Group : "g" ,
45- Kind : "K" ,
44+ Group : "g" ,
45+ Kind : "K" ,
4646 Version : "v1" ,
47- Name : "Ks.g" ,
47+ Name : "Ks.g" ,
4848 },
4949 },
5050 wantRequired : []* DefinitionKey {
5151 {
52- Group : "g2" ,
53- Kind : "K2" ,
52+ Group : "g2" ,
53+ Kind : "K2" ,
5454 Version : "v1" ,
55- Name : "K2s.g" ,
55+ Name : "K2s.g" ,
5656 },
5757 },
5858 },
@@ -61,7 +61,7 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) {
6161 fields : fields {
6262 TypeMeta : v1.TypeMeta {},
6363 ObjectMeta : v1.ObjectMeta {},
64- Spec : json .RawMessage (`
64+ Spec : json .RawMessage (`
6565 {
6666 "apiservicedefinitions": {
6767 "owned": [
@@ -72,10 +72,10 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) {
7272 },
7373 wantOwned : []* DefinitionKey {
7474 {
75- Group : "g" ,
76- Kind : "K" ,
75+ Group : "g" ,
76+ Kind : "K" ,
7777 Version : "v1" ,
78- Name : "Ks.g" ,
78+ Name : "Ks.g" ,
7979 },
8080 },
8181 },
@@ -84,7 +84,7 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) {
8484 fields : fields {
8585 TypeMeta : v1.TypeMeta {},
8686 ObjectMeta : v1.ObjectMeta {},
87- Spec : json .RawMessage (`
87+ Spec : json .RawMessage (`
8888 {
8989 "apiservicedefinitions": {
9090 "required": [
@@ -95,10 +95,10 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) {
9595 },
9696 wantRequired : []* DefinitionKey {
9797 {
98- Group : "g2" ,
99- Kind : "K2" ,
98+ Group : "g2" ,
99+ Kind : "K2" ,
100100 Version : "v1" ,
101- Name : "K2s.g" ,
101+ Name : "K2s.g" ,
102102 },
103103 },
104104 },
@@ -115,18 +115,17 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) {
115115 fields : fields {
116116 TypeMeta : v1.TypeMeta {},
117117 ObjectMeta : v1.ObjectMeta {},
118- Spec : json .RawMessage (`
118+ Spec : json .RawMessage (`
119119 {
120120 "apiservicedefinitions": {
121121 splat: [
122122 {"glarp": "g2", "version": "v1", "kind": "K2", "name": "K2s.g"}
123123 ]
124124 }
125125 }` ),
126-
127126 },
128- wantErr :true ,
129- }, }
127+ wantErr : true ,
128+ }}
130129 for _ , tt := range tests {
131130 t .Run (tt .name , func (t * testing.T ) {
132131 csv := & ClusterServiceVersion {
@@ -167,7 +166,7 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) {
167166 fields : fields {
168167 TypeMeta : v1.TypeMeta {},
169168 ObjectMeta : v1.ObjectMeta {},
170- Spec : json .RawMessage (`
169+ Spec : json .RawMessage (`
171170 {
172171 "customresourcedefinitions": {
173172 "owned": [
@@ -181,18 +180,18 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) {
181180 },
182181 wantOwned : []* DefinitionKey {
183182 {
184- Group : "g" ,
185- Kind : "K" ,
183+ Group : "g" ,
184+ Kind : "K" ,
186185 Version : "v1" ,
187- Name : "Ks.g" ,
186+ Name : "Ks.g" ,
188187 },
189188 },
190189 wantRequired : []* DefinitionKey {
191190 {
192- Group : "g2" ,
193- Kind : "K2" ,
191+ Group : "g2" ,
192+ Kind : "K2" ,
194193 Version : "v1" ,
195- Name : "K2s.g" ,
194+ Name : "K2s.g" ,
196195 },
197196 },
198197 },
@@ -201,7 +200,7 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) {
201200 fields : fields {
202201 TypeMeta : v1.TypeMeta {},
203202 ObjectMeta : v1.ObjectMeta {},
204- Spec : json .RawMessage (`
203+ Spec : json .RawMessage (`
205204 {
206205 "customresourcedefinitions": {
207206 "owned": [
@@ -212,10 +211,10 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) {
212211 },
213212 wantOwned : []* DefinitionKey {
214213 {
215- Group : "g" ,
216- Kind : "K" ,
214+ Group : "g" ,
215+ Kind : "K" ,
217216 Version : "v1" ,
218- Name : "Ks.g" ,
217+ Name : "Ks.g" ,
219218 },
220219 },
221220 },
@@ -224,7 +223,7 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) {
224223 fields : fields {
225224 TypeMeta : v1.TypeMeta {},
226225 ObjectMeta : v1.ObjectMeta {},
227- Spec : json .RawMessage (`
226+ Spec : json .RawMessage (`
228227 {
229228 "customresourcedefinitions": {
230229 "required": [
@@ -235,10 +234,10 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) {
235234 },
236235 wantRequired : []* DefinitionKey {
237236 {
238- Group : "g2" ,
239- Kind : "K2" ,
237+ Group : "g2" ,
238+ Kind : "K2" ,
240239 Version : "v1" ,
241- Name : "K2s.g" ,
240+ Name : "K2s.g" ,
242241 },
243242 },
244243 },
@@ -255,17 +254,16 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) {
255254 fields : fields {
256255 TypeMeta : v1.TypeMeta {},
257256 ObjectMeta : v1.ObjectMeta {},
258- Spec : json .RawMessage (`
257+ Spec : json .RawMessage (`
259258 {
260259 "customresourcedefinitions": {
261260 splat: [
262261 {"glarp": "g2", "version": "v1", "kind": "K2", "name": "K2s.g"}
263262 ]
264263 }
265264 }` ),
266-
267265 },
268- wantErr :true ,
266+ wantErr : true ,
269267 },
270268 }
271269 for _ , tt := range tests {
@@ -387,7 +385,7 @@ func TestClusterServiceVersion_GetSkips(t *testing.T) {
387385 Spec : json .RawMessage (`{"skips": 5}` ),
388386 },
389387 wantErr : true ,
390- }, }
388+ }}
391389 for _ , tt := range tests {
392390 t .Run (tt .name , func (t * testing.T ) {
393391 csv := & ClusterServiceVersion {
@@ -492,7 +490,7 @@ func TestClusterServiceVersion_GetRelatedImages(t *testing.T) {
492490 fields : fields {
493491 TypeMeta : v1.TypeMeta {},
494492 ObjectMeta : v1.ObjectMeta {},
495- Spec : json .RawMessage (`{"relatedImages": [
493+ Spec : json .RawMessage (`{"relatedImages": [
496494 {"name": "test", "image": "quay.io/etcd/etcd-operator@sha256:123"}
497495 ]}` ),
498496 },
@@ -503,7 +501,7 @@ func TestClusterServiceVersion_GetRelatedImages(t *testing.T) {
503501 fields : fields {
504502 TypeMeta : v1.TypeMeta {},
505503 ObjectMeta : v1.ObjectMeta {},
506- Spec : json .RawMessage (`{"relatedImages": [
504+ Spec : json .RawMessage (`{"relatedImages": [
507505 {"name": "test", "image": "quay.io/etcd/etcd-operator@sha256:123"},
508506 {"name": "operand", "image": "quay.io/etcd/etcd@sha256:123"}
509507 ]}` ),
@@ -563,7 +561,7 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) {
563561 "containers":[]
564562 }}}}]}}}` ),
565563 },
566- want : nil ,
564+ want : nil ,
567565 wantErr : true ,
568566 },
569567 {
@@ -588,7 +586,7 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) {
588586 }
589587 }}]}}}` ),
590588 },
591- want : map [string ]struct {}{"quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" :{}},
589+ want : map [string ]struct {}{"quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" : {}},
592590 },
593591 {
594592 name : "two container images" ,
@@ -617,7 +615,7 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) {
617615 }
618616 }}]}}}` ),
619617 },
620- want : map [string ]struct {}{"quay.io/coreos/etcd-operator-2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" :{}, "quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" :{}},
618+ want : map [string ]struct {}{"quay.io/coreos/etcd-operator-2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" : {}, "quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" : {}},
621619 },
622620 {
623621 name : "init container image" ,
@@ -651,7 +649,7 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) {
651649 }
652650 }` ),
653651 },
654- want : map [string ]struct {}{"quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" :{}},
652+ want : map [string ]struct {}{"quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" : {}},
655653 },
656654 {
657655 name : "two init container images" ,
@@ -690,7 +688,7 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) {
690688 }
691689 }` ),
692690 },
693- want : map [string ]struct {}{"quay.io/coreos/etcd-operator2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" :{}, "quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" :{}},
691+ want : map [string ]struct {}{"quay.io/coreos/etcd-operator2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" : {}, "quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" : {}},
694692 },
695693 {
696694 name : "container and init container" ,
@@ -741,7 +739,7 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) {
741739 }
742740 }` ),
743741 },
744- want : map [string ]struct {}{"quay.io/coreos/etcd-operator2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" :{}, "quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" :struct {}{}, "quay.io/coreos/init-etcd-operator2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" :{}, "quay.io/coreos/init-etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" :{}},
742+ want : map [string ]struct {}{"quay.io/coreos/etcd-operator2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" : {}, "quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" : struct {}{}, "quay.io/coreos/init-etcd-operator2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" : {}, "quay.io/coreos/init-etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2" : {}},
745743 },
746744 }
747745 for _ , tt := range tests {
0 commit comments