Skip to content

Commit cf88031

Browse files
committed
disallow nulls in applied configurations
1 parent ca99bda commit cf88031

File tree

7 files changed

+348
-308
lines changed

7 files changed

+348
-308
lines changed

merge/ignore_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,26 +157,26 @@ func TestIgnoredFieldsUsesVersions(t *testing.T) {
157157
Object: `
158158
mapOfMapsRecursive:
159159
a:
160-
b:
160+
b: {}
161161
c:
162-
d:
162+
d: {}
163163
`,
164164
APIVersion: "v1",
165165
},
166166
Apply{
167167
Manager: "apply-two",
168168
Object: `
169169
mapOfMapsRecursive:
170-
aa:
170+
aa: {}
171171
cc:
172-
dd:
172+
dd: {}
173173
`,
174174
APIVersion: "v2",
175175
},
176176
Apply{
177177
Manager: "apply-one",
178178
Object: `
179-
mapOfMapsRecursive:
179+
mapOfMapsRecursive: {}
180180
`,
181181
APIVersion: "v4",
182182
},
@@ -280,9 +280,9 @@ func TestIgnoredFieldsUsesVersions(t *testing.T) {
280280
Object: `
281281
mapOfMapsRecursive:
282282
a:
283-
b:
283+
b: {}
284284
c:
285-
d:
285+
d: {}
286286
`,
287287
APIVersion: "v1",
288288
},
@@ -291,9 +291,9 @@ func TestIgnoredFieldsUsesVersions(t *testing.T) {
291291
Object: `
292292
mapOfMapsRecursive:
293293
a:
294-
b:
294+
b: {}
295295
c:
296-
e:
296+
e: {}
297297
`,
298298
APIVersion: "v2",
299299
},

merge/multiple_appliers_test.go

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -599,19 +599,19 @@ func TestMultipleAppliersNestedType(t *testing.T) {
599599
Object: `
600600
mapOfMapsRecursive:
601601
a:
602-
b:
602+
b: {}
603603
c:
604-
d:
604+
d: {}
605605
`,
606606
APIVersion: "v1",
607607
},
608608
Apply{
609609
Manager: "apply-two",
610610
Object: `
611611
mapOfMapsRecursive:
612-
a:
612+
a: {}
613613
c:
614-
d:
614+
d: {}
615615
`,
616616
APIVersion: "v2",
617617
},
@@ -621,10 +621,10 @@ func TestMultipleAppliersNestedType(t *testing.T) {
621621
mapOfMapsRecursive:
622622
a:
623623
b:
624-
c:
624+
c: {}
625625
c:
626626
d:
627-
e:
627+
e: {}
628628
`,
629629
APIVersion: "v3",
630630
},
@@ -635,11 +635,11 @@ func TestMultipleAppliersNestedType(t *testing.T) {
635635
a:
636636
b:
637637
c:
638-
d:
638+
d: {}
639639
c:
640640
d:
641641
e:
642-
f:
642+
f: {}
643643
`,
644644
APIVersion: "v2",
645645
},
@@ -651,12 +651,12 @@ func TestMultipleAppliersNestedType(t *testing.T) {
651651
b:
652652
c:
653653
d:
654-
e:
654+
e: {}
655655
c:
656656
d:
657657
e:
658658
f:
659-
g:
659+
g: {}
660660
`,
661661
APIVersion: "v3",
662662
},
@@ -667,15 +667,15 @@ func TestMultipleAppliersNestedType(t *testing.T) {
667667
`,
668668
APIVersion: "v4",
669669
},
670-
},
670+
}, // TODO(jpetz): Why do we need a {} on the object?
671671
Object: `
672672
mapOfMapsRecursive:
673673
a:
674674
c:
675675
d:
676676
e:
677677
f:
678-
g:
678+
g: {}
679679
`,
680680
APIVersion: "v1",
681681
Managed: fieldpath.ManagedFields{
@@ -724,18 +724,18 @@ func TestMultipleAppliersDeducedType(t *testing.T) {
724724
Manager: "apply-one",
725725
Object: `
726726
a:
727-
b:
727+
b: {}
728728
c:
729-
d:
729+
d: {}
730730
`,
731731
APIVersion: "v1",
732732
},
733733
Apply{
734734
Manager: "apply-two",
735735
Object: `
736-
a:
736+
a: {}
737737
c:
738-
d:
738+
d: {}
739739
`,
740740
APIVersion: "v2",
741741
},
@@ -744,10 +744,10 @@ func TestMultipleAppliersDeducedType(t *testing.T) {
744744
Object: `
745745
a:
746746
b:
747-
c:
747+
c: {}
748748
c:
749749
d:
750-
e:
750+
e: {}
751751
`,
752752
APIVersion: "v3",
753753
},
@@ -757,11 +757,11 @@ func TestMultipleAppliersDeducedType(t *testing.T) {
757757
a:
758758
b:
759759
c:
760-
d:
760+
d: {}
761761
c:
762762
d:
763763
e:
764-
f:
764+
f: {}
765765
`,
766766
APIVersion: "v2",
767767
},
@@ -772,12 +772,12 @@ func TestMultipleAppliersDeducedType(t *testing.T) {
772772
b:
773773
c:
774774
d:
775-
e:
775+
e: {}
776776
c:
777777
d:
778778
e:
779779
f:
780-
g:
780+
g: {}
781781
`,
782782
APIVersion: "v3",
783783
},
@@ -793,7 +793,7 @@ func TestMultipleAppliersDeducedType(t *testing.T) {
793793
d:
794794
e:
795795
f:
796-
g:
796+
g: {}
797797
`,
798798
APIVersion: "v1",
799799
Managed: fieldpath.ManagedFields{
@@ -843,19 +843,19 @@ func TestMultipleAppliersRealConversion(t *testing.T) {
843843
Object: `
844844
mapOfMapsRecursive:
845845
a:
846-
b:
846+
b: {}
847847
c:
848-
d:
848+
d: {}
849849
`,
850850
APIVersion: "v1",
851851
},
852852
Apply{
853853
Manager: "apply-two",
854854
Object: `
855855
mapOfMapsRecursive:
856-
aa:
856+
aa: {}
857857
cc:
858-
dd:
858+
dd: {}
859859
`,
860860
APIVersion: "v2",
861861
},
@@ -866,11 +866,11 @@ func TestMultipleAppliersRealConversion(t *testing.T) {
866866
aaa:
867867
bbb:
868868
ccc:
869-
ddd:
869+
ddd: {}
870870
ccc:
871871
ddd:
872872
eee:
873-
fff:
873+
fff: {}
874874
`,
875875
APIVersion: "v3",
876876
},
@@ -919,7 +919,7 @@ func TestMultipleAppliersRealConversion(t *testing.T) {
919919
mapOfMapsRecursive:
920920
a:
921921
b:
922-
c:
922+
c: {}
923923
`,
924924
APIVersion: "v1",
925925
},
@@ -928,18 +928,18 @@ func TestMultipleAppliersRealConversion(t *testing.T) {
928928
Object: `
929929
mapOfMapsRecursive:
930930
aa:
931-
bb:
931+
bb: {}
932932
cc:
933-
dd:
933+
dd: {}
934934
`,
935935
APIVersion: "v2",
936936
},
937937
Apply{
938938
Manager: "apply",
939939
Object: `
940940
mapOfMapsRecursive:
941-
aaa:
942-
ccc:
941+
aaa: {}
942+
ccc: {}
943943
`,
944944
APIVersion: "v3",
945945
},

merge/nested_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ func TestUpdateNestedType(t *testing.T) {
466466
mapOfMapsRecursive:
467467
a:
468468
b:
469-
c:
469+
c: {}
470470
`,
471471
APIVersion: "v1",
472472
},
@@ -476,7 +476,7 @@ func TestUpdateNestedType(t *testing.T) {
476476
mapOfMapsRecursive:
477477
a:
478478
d:
479-
c:
479+
c: {}
480480
`,
481481
APIVersion: "v1",
482482
},
@@ -485,7 +485,7 @@ func TestUpdateNestedType(t *testing.T) {
485485
mapOfMapsRecursive:
486486
a:
487487
d:
488-
c:
488+
c: {}
489489
`,
490490
APIVersion: "v1",
491491
Managed: fieldpath.ManagedFields{

0 commit comments

Comments
 (0)