@@ -263,13 +263,19 @@ func TestPatchHelper(t *testing.T) {
263
263
264
264
testConditionCopy := conditions .Get (objCopy , "TestCondition" )
265
265
testConditionAfter := conditions .Get (objAfter , "TestCondition" )
266
+ if testConditionCopy == nil || testConditionAfter == nil {
267
+ return false
268
+ }
266
269
ok , err := conditions .MatchCondition (* testConditionCopy ).Match (* testConditionAfter )
267
270
if err != nil || ! ok {
268
271
return false
269
272
}
270
273
271
274
readyBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
272
275
readyAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
276
+ if readyBefore == nil || readyAfter == nil {
277
+ return false
278
+ }
273
279
ok , err = conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
274
280
if err != nil || ! ok {
275
281
return false
@@ -329,13 +335,19 @@ func TestPatchHelper(t *testing.T) {
329
335
330
336
testConditionCopy := conditions .Get (objCopy , "TestCondition" )
331
337
testConditionAfter := conditions .Get (objAfter , "TestCondition" )
338
+ if testConditionCopy == nil || testConditionAfter == nil {
339
+ return false
340
+ }
332
341
ok , err := conditions .MatchCondition (* testConditionCopy ).Match (* testConditionAfter )
333
342
if err != nil || ! ok {
334
343
return false
335
344
}
336
345
337
346
readyBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
338
347
readyAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
348
+ if readyBefore == nil || readyAfter == nil {
349
+ return false
350
+ }
339
351
ok , err = conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
340
352
if err != nil || ! ok {
341
353
return false
@@ -1135,13 +1147,19 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
1135
1147
1136
1148
testConditionCopy := conditions .Get (objCopy , "TestCondition" )
1137
1149
testConditionAfter := conditions .Get (objAfter , "TestCondition" )
1150
+ if testConditionCopy == nil || testConditionAfter == nil {
1151
+ return false
1152
+ }
1138
1153
ok , err := conditions .MatchCondition (* testConditionCopy ).Match (* testConditionAfter )
1139
1154
if err != nil || ! ok {
1140
1155
return false
1141
1156
}
1142
1157
1143
1158
readyBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
1144
1159
readyAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
1160
+ if readyBefore == nil || readyAfter == nil {
1161
+ return false
1162
+ }
1145
1163
ok , err = conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
1146
1164
if err != nil || ! ok {
1147
1165
return false
@@ -1199,13 +1217,19 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
1199
1217
1200
1218
testConditionCopy := conditions .Get (objCopy , "TestCondition" )
1201
1219
testConditionAfter := conditions .Get (objAfter , "TestCondition" )
1220
+ if testConditionCopy == nil || testConditionAfter == nil {
1221
+ return false
1222
+ }
1202
1223
ok , err := conditions .MatchCondition (* testConditionCopy ).Match (* testConditionAfter )
1203
1224
if err != nil || ! ok {
1204
1225
return false
1205
1226
}
1206
1227
1207
1228
readyBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
1208
1229
readyAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
1230
+ if readyBefore == nil || readyAfter == nil {
1231
+ return false
1232
+ }
1209
1233
ok , err = conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
1210
1234
if err != nil || ! ok {
1211
1235
return false
@@ -1539,28 +1563,37 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
1539
1563
1540
1564
testConditionCopy := conditions .Get (objCopy , "Test" )
1541
1565
testConditionAfter := conditions .Get (objAfter , "Test" )
1566
+ if testConditionCopy == nil || testConditionAfter == nil {
1567
+ return false
1568
+ }
1542
1569
ok , err := conditions .MatchCondition (* testConditionCopy ).Match (* testConditionAfter )
1543
1570
if err != nil || ! ok {
1544
1571
return false
1545
1572
}
1546
1573
1547
1574
readyBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
1548
1575
readyAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
1576
+ if readyBefore == nil || readyAfter == nil {
1577
+ return false
1578
+ }
1549
1579
ok , err = conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
1550
1580
if err != nil || ! ok {
1551
1581
return false
1552
1582
}
1553
1583
1554
1584
testV1Beta2ConditionCopy := v1beta2conditions .Get (objCopy , "Test" )
1555
1585
testV1Beta2ConditionAfter := v1beta2conditions .Get (objAfter , "Test" )
1586
+ if testV1Beta2ConditionCopy == nil || testV1Beta2ConditionAfter == nil {
1587
+ return false
1588
+ }
1556
1589
ok , err = v1beta2conditions .MatchCondition (* testV1Beta2ConditionCopy ).Match (* testV1Beta2ConditionAfter )
1557
1590
if err != nil || ! ok {
1558
1591
return false
1559
1592
}
1560
1593
1561
1594
readyV1Beta2Before := v1beta2conditions .Get (obj , "Ready" )
1562
1595
readyV1Beta2After := v1beta2conditions .Get (objAfter , "Ready" )
1563
- if err ! = nil {
1596
+ if readyV1Beta2Before == nil || readyV1Beta2After = = nil {
1564
1597
return false
1565
1598
}
1566
1599
ok , err = v1beta2conditions .MatchCondition (* readyV1Beta2Before ).Match (* readyV1Beta2After )
@@ -1623,27 +1656,39 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
1623
1656
1624
1657
testConditionCopy := conditions .Get (objCopy , "Test" )
1625
1658
testConditionAfter := conditions .Get (objAfter , "Test" )
1659
+ if testConditionCopy == nil || testConditionAfter == nil {
1660
+ return false
1661
+ }
1626
1662
ok , err := conditions .MatchCondition (* testConditionCopy ).Match (* testConditionAfter )
1627
1663
if err != nil || ! ok {
1628
1664
return false
1629
1665
}
1630
1666
1631
1667
readyBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
1632
1668
readyAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
1669
+ if readyBefore == nil || readyAfter == nil {
1670
+ return false
1671
+ }
1633
1672
ok , err = conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
1634
1673
if err != nil || ! ok {
1635
1674
return false
1636
1675
}
1637
1676
1638
1677
testV1Beta2ConditionCopy := v1beta2conditions .Get (objCopy , "Test" )
1639
1678
testV1Beta2ConditionAfter := v1beta2conditions .Get (objAfter , "Test" )
1679
+ if testV1Beta2ConditionCopy == nil || testV1Beta2ConditionAfter == nil {
1680
+ return false
1681
+ }
1640
1682
ok , err = v1beta2conditions .MatchCondition (* testV1Beta2ConditionCopy ).Match (* testV1Beta2ConditionAfter )
1641
1683
if err != nil || ! ok {
1642
1684
return false
1643
1685
}
1644
1686
1645
1687
readyV1Beta2Before := v1beta2conditions .Get (obj , "Ready" )
1646
1688
readyV1Beta2After := v1beta2conditions .Get (objAfter , "Ready" )
1689
+ if readyV1Beta2Before == nil || readyV1Beta2After == nil {
1690
+ return false
1691
+ }
1647
1692
ok , err = v1beta2conditions .MatchCondition (* readyV1Beta2Before ).Match (* readyV1Beta2After )
1648
1693
if err != nil || ! ok {
1649
1694
return false
@@ -1796,13 +1841,19 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
1796
1841
1797
1842
readyBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
1798
1843
readyAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
1844
+ if readyBefore == nil || readyAfter == nil {
1845
+ return false
1846
+ }
1799
1847
ok , err := conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
1800
1848
if err != nil || ! ok {
1801
1849
return false
1802
1850
}
1803
1851
1804
1852
readyV1Beta2Before := v1beta2conditions .Get (obj , "Ready" )
1805
1853
readyV1Beta2After := v1beta2conditions .Get (objAfter , "Ready" )
1854
+ if readyV1Beta2Before == nil || readyV1Beta2After == nil {
1855
+ return false
1856
+ }
1806
1857
ok , err = v1beta2conditions .MatchCondition (* readyV1Beta2Before ).Match (* readyV1Beta2After )
1807
1858
if err != nil || ! ok {
1808
1859
return false
@@ -1860,13 +1911,19 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
1860
1911
1861
1912
readyBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
1862
1913
readyAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
1914
+ if readyBefore == nil || readyAfter == nil {
1915
+ return false
1916
+ }
1863
1917
ok , err := conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
1864
1918
if err != nil || ! ok {
1865
1919
return false
1866
1920
}
1867
1921
1868
1922
readyV1Beta2Before := v1beta2conditions .Get (obj , "Ready" )
1869
1923
readyV1Beta2After := v1beta2conditions .Get (objAfter , "Ready" )
1924
+ if readyV1Beta2Before == nil || readyV1Beta2After == nil {
1925
+ return false
1926
+ }
1870
1927
ok , err = v1beta2conditions .MatchCondition (* readyV1Beta2Before ).Match (* readyV1Beta2After )
1871
1928
if err != nil || ! ok {
1872
1929
return false
@@ -2046,27 +2103,39 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
2046
2103
2047
2104
testBackCompatibilityCopy := conditions .Get (objCopy , "Test" )
2048
2105
testBackCompatibilityAfter := conditions .Get (objAfter , "Test" )
2106
+ if testBackCompatibilityCopy == nil || testBackCompatibilityAfter == nil {
2107
+ return false
2108
+ }
2049
2109
ok , err := conditions .MatchCondition (* testBackCompatibilityCopy ).Match (* testBackCompatibilityAfter )
2050
2110
if err != nil || ! ok {
2051
2111
return false
2052
2112
}
2053
2113
2054
2114
readyBackCompatibilityBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
2055
2115
readyBackCompatibilityAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
2116
+ if readyBackCompatibilityBefore == nil || readyBackCompatibilityAfter == nil {
2117
+ return false
2118
+ }
2056
2119
ok , err = conditions .MatchCondition (* readyBackCompatibilityBefore ).Match (* readyBackCompatibilityAfter )
2057
2120
if err != nil || ! ok {
2058
2121
return false
2059
2122
}
2060
2123
2061
2124
testConditionCopy := v1beta2conditions .Get (objCopy , "Test" )
2062
2125
testConditionAfter := v1beta2conditions .Get (objAfter , "Test" )
2126
+ if testConditionCopy == nil || testConditionAfter == nil {
2127
+ return false
2128
+ }
2063
2129
ok , err = v1beta2conditions .MatchCondition (* testConditionCopy ).Match (* testConditionAfter )
2064
2130
if err != nil || ! ok {
2065
2131
return false
2066
2132
}
2067
2133
2068
2134
readyBefore := v1beta2conditions .Get (obj , "Ready" )
2069
2135
readyAfter := v1beta2conditions .Get (objAfter , "Ready" )
2136
+ if readyBefore == nil || readyAfter == nil {
2137
+ return false
2138
+ }
2070
2139
ok , err = v1beta2conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
2071
2140
if err != nil || ! ok {
2072
2141
return false
@@ -2127,27 +2196,39 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
2127
2196
2128
2197
testBackCompatibilityCopy := conditions .Get (objCopy , "Test" )
2129
2198
testBackCompatibilityAfter := conditions .Get (objAfter , "Test" )
2199
+ if testBackCompatibilityCopy == nil || testBackCompatibilityAfter == nil {
2200
+ return false
2201
+ }
2130
2202
ok , err := conditions .MatchCondition (* testBackCompatibilityCopy ).Match (* testBackCompatibilityAfter )
2131
2203
if err != nil || ! ok {
2132
2204
return false
2133
2205
}
2134
2206
2135
2207
readyBackCompatibilityBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
2136
2208
readyBackCompatibilityAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
2209
+ if readyBackCompatibilityBefore == nil || readyBackCompatibilityAfter == nil {
2210
+ return false
2211
+ }
2137
2212
ok , err = conditions .MatchCondition (* readyBackCompatibilityBefore ).Match (* readyBackCompatibilityAfter )
2138
2213
if err != nil || ! ok {
2139
2214
return false
2140
2215
}
2141
2216
2142
2217
testConditionCopy := v1beta2conditions .Get (objCopy , "Test" )
2143
2218
testConditionAfter := v1beta2conditions .Get (objAfter , "Test" )
2219
+ if testConditionCopy == nil || testConditionAfter == nil {
2220
+ return false
2221
+ }
2144
2222
ok , err = v1beta2conditions .MatchCondition (* testConditionCopy ).Match (* testConditionAfter )
2145
2223
if err != nil || ! ok {
2146
2224
return false
2147
2225
}
2148
2226
2149
2227
readyBefore := v1beta2conditions .Get (obj , "Ready" )
2150
2228
readyAfter := v1beta2conditions .Get (objAfter , "Ready" )
2229
+ if readyBefore == nil || readyAfter == nil {
2230
+ return false
2231
+ }
2151
2232
ok , err = v1beta2conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
2152
2233
if err != nil || ! ok {
2153
2234
return false
@@ -2300,13 +2381,19 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
2300
2381
2301
2382
readyBackCompatibilityBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
2302
2383
readyBackCompatibilityAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
2384
+ if readyBackCompatibilityBefore == nil || readyBackCompatibilityAfter == nil {
2385
+ return false
2386
+ }
2303
2387
ok , err := conditions .MatchCondition (* readyBackCompatibilityBefore ).Match (* readyBackCompatibilityAfter )
2304
2388
if err != nil || ! ok {
2305
2389
return false
2306
2390
}
2307
2391
2308
2392
readyBefore := v1beta2conditions .Get (obj , "Ready" )
2309
2393
readyAfter := v1beta2conditions .Get (objAfter , "Ready" )
2394
+ if readyBefore == nil || readyAfter == nil {
2395
+ return false
2396
+ }
2310
2397
ok , err = v1beta2conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
2311
2398
if err != nil || ! ok {
2312
2399
return false
@@ -2364,13 +2451,19 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
2364
2451
2365
2452
readyBackCompatibilityBefore := conditions .Get (obj , clusterv1 .ReadyCondition )
2366
2453
readyBackCompatibilityAfter := conditions .Get (objAfter , clusterv1 .ReadyCondition )
2454
+ if readyBackCompatibilityBefore == nil || readyBackCompatibilityAfter == nil {
2455
+ return false
2456
+ }
2367
2457
ok , err := conditions .MatchCondition (* readyBackCompatibilityBefore ).Match (* readyBackCompatibilityAfter )
2368
2458
if err != nil || ! ok {
2369
2459
return false
2370
2460
}
2371
2461
2372
2462
readyBefore := v1beta2conditions .Get (obj , "Ready" )
2373
2463
readyAfter := v1beta2conditions .Get (objAfter , "Ready" )
2464
+ if readyBefore == nil || readyAfter == nil {
2465
+ return false
2466
+ }
2374
2467
ok , err = v1beta2conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
2375
2468
if err != nil || ! ok {
2376
2469
return false
@@ -2532,13 +2625,19 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
2532
2625
2533
2626
testConditionCopy := v1beta2conditions .Get (objCopy , "Test" )
2534
2627
testConditionAfter := v1beta2conditions .Get (objAfter , "Test" )
2628
+ if testConditionCopy == nil || testConditionAfter == nil {
2629
+ return false
2630
+ }
2535
2631
ok , err := v1beta2conditions .MatchCondition (* testConditionCopy ).Match (* testConditionAfter )
2536
2632
if err != nil || ! ok {
2537
2633
return false
2538
2634
}
2539
2635
2540
2636
readyBefore := v1beta2conditions .Get (obj , "Ready" )
2541
2637
readyAfter := v1beta2conditions .Get (objAfter , "Ready" )
2638
+ if readyBefore == nil || readyAfter == nil {
2639
+ return false
2640
+ }
2542
2641
ok , err = v1beta2conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
2543
2642
if err != nil || ! ok {
2544
2643
return false
@@ -2597,13 +2696,19 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
2597
2696
2598
2697
testConditionCopy := v1beta2conditions .Get (objCopy , "Test" )
2599
2698
testConditionAfter := v1beta2conditions .Get (objAfter , "Test" )
2699
+ if testConditionCopy == nil || testConditionAfter == nil {
2700
+ return false
2701
+ }
2600
2702
ok , err := v1beta2conditions .MatchCondition (* testConditionCopy ).Match (* testConditionAfter )
2601
2703
if err != nil || ! ok {
2602
2704
return false
2603
2705
}
2604
2706
2605
2707
readyBefore := v1beta2conditions .Get (obj , "Ready" )
2606
2708
readyAfter := v1beta2conditions .Get (objAfter , "Ready" )
2709
+ if readyBefore == nil || readyAfter == nil {
2710
+ return false
2711
+ }
2607
2712
ok , err = v1beta2conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
2608
2713
if err != nil || ! ok {
2609
2714
return false
@@ -2707,6 +2812,9 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
2707
2812
2708
2813
readyBefore := v1beta2conditions .Get (obj , "Ready" )
2709
2814
readyAfter := v1beta2conditions .Get (objAfter , "Ready" )
2815
+ if readyBefore == nil || readyAfter == nil {
2816
+ return false
2817
+ }
2710
2818
ok , err := v1beta2conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
2711
2819
if err != nil || ! ok {
2712
2820
return false
@@ -2762,6 +2870,9 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
2762
2870
2763
2871
readyBefore := v1beta2conditions .Get (obj , "Ready" )
2764
2872
readyAfter := v1beta2conditions .Get (objAfter , "Ready" )
2873
+ if readyBefore == nil || readyAfter == nil {
2874
+ return false
2875
+ }
2765
2876
ok , err := v1beta2conditions .MatchCondition (* readyBefore ).Match (* readyAfter )
2766
2877
if err != nil || ! ok {
2767
2878
return false
0 commit comments