@@ -2434,6 +2434,7 @@ func TestNeedsClientSideApplyMigration(t *testing.T) {
2434
2434
}
2435
2435
}
2436
2436
2437
+ << << << < HEAD
2437
2438
<< << << < HEAD
2438
2439
func diffResultListClusterResource () * diff.DiffResultList {
2439
2440
ns1 := testingutils .NewNamespace ()
@@ -2462,11 +2463,16 @@ func diffResultListClusterResource() *diff.DiffResultList {
2462
2463
func templateWithStorage (name , storage string ) map [string ]interface {} {
2463
2464
return map [string ]interface {}{
2464
2465
"metadata" : map [string ]interface {}{
2466
+ == == == =
2467
+ func templateWithStorage (name , storage string ) map [string ]any {
2468
+ return map [string ]any {
2469
+ "metadata" : map [string ]any {
2470
+ >> >> >> > 2 a210a3 (resolve linter issues )
2465
2471
"name" : name ,
2466
2472
},
2467
- "spec" : map [string ]interface {} {
2468
- "resources" : map [string ]interface {} {
2469
- "requests" : map [string ]interface {} {
2473
+ "spec" : map [string ]any {
2474
+ "resources" : map [string ]any {
2475
+ "requests" : map [string ]any {
2470
2476
"storage" : storage ,
2471
2477
},
2472
2478
},
@@ -2477,16 +2483,16 @@ func templateWithStorage(name, storage string) map[string]interface{} {
2477
2483
func TestStatefulSetImmutableFieldErrors (t * testing .T ) {
2478
2484
tests := []struct {
2479
2485
name string
2480
- currentSpec map [string ]interface {}
2481
- desiredSpec map [string ]interface {}
2486
+ currentSpec map [string ]any
2487
+ desiredSpec map [string ]any
2482
2488
expectedMessage string
2483
2489
}{
2484
2490
{
2485
2491
name : "single field change - serviceName" ,
2486
- currentSpec : map [string ]interface {} {
2492
+ currentSpec : map [string ]any {
2487
2493
"serviceName" : "old-svc" ,
2488
2494
},
2489
- desiredSpec : map [string ]interface {} {
2495
+ desiredSpec : map [string ]any {
2490
2496
"serviceName" : "new-svc" ,
2491
2497
},
2492
2498
expectedMessage : `attempting to change immutable fields:
@@ -2498,31 +2504,31 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2498
2504
},
2499
2505
{
2500
2506
name : "volumeClaimTemplates change with storage size" ,
2501
- currentSpec : map [string ]interface {} {
2502
- "volumeClaimTemplates" : []interface {} {
2503
- map [string ]interface {} {
2504
- "metadata" : map [string ]interface {} {
2507
+ currentSpec : map [string ]any {
2508
+ "volumeClaimTemplates" : []any {
2509
+ map [string ]any {
2510
+ "metadata" : map [string ]any {
2505
2511
"name" : "data" ,
2506
2512
},
2507
- "spec" : map [string ]interface {} {
2508
- "resources" : map [string ]interface {} {
2509
- "requests" : map [string ]interface {} {
2513
+ "spec" : map [string ]any {
2514
+ "resources" : map [string ]any {
2515
+ "requests" : map [string ]any {
2510
2516
"storage" : "1Gi" ,
2511
2517
},
2512
2518
},
2513
2519
},
2514
2520
},
2515
2521
},
2516
2522
},
2517
- desiredSpec : map [string ]interface {} {
2518
- "volumeClaimTemplates" : []interface {} {
2519
- map [string ]interface {} {
2520
- "metadata" : map [string ]interface {} {
2523
+ desiredSpec : map [string ]any {
2524
+ "volumeClaimTemplates" : []any {
2525
+ map [string ]any {
2526
+ "metadata" : map [string ]any {
2521
2527
"name" : "data" ,
2522
2528
},
2523
- "spec" : map [string ]interface {} {
2524
- "resources" : map [string ]interface {} {
2525
- "requests" : map [string ]interface {} {
2529
+ "spec" : map [string ]any {
2530
+ "resources" : map [string ]any {
2531
+ "requests" : map [string ]any {
2526
2532
"storage" : "2Gi" ,
2527
2533
},
2528
2534
},
@@ -2539,16 +2545,16 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2539
2545
},
2540
2546
{
2541
2547
name : "selector change" ,
2542
- currentSpec : map [string ]interface {} {
2543
- "selector" : map [string ]interface {} {
2544
- "matchLabels" : map [string ]interface {} {
2548
+ currentSpec : map [string ]any {
2549
+ "selector" : map [string ]any {
2550
+ "matchLabels" : map [string ]any {
2545
2551
"app" : "old-app" ,
2546
2552
},
2547
2553
},
2548
2554
},
2549
- desiredSpec : map [string ]interface {} {
2550
- "selector" : map [string ]interface {} {
2551
- "matchLabels" : map [string ]interface {} {
2555
+ desiredSpec : map [string ]any {
2556
+ "selector" : map [string ]any {
2557
+ "matchLabels" : map [string ]any {
2552
2558
"app" : "new-app" ,
2553
2559
},
2554
2560
},
@@ -2562,14 +2568,14 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2562
2568
},
2563
2569
{
2564
2570
name : "volumeClaimTemplates change from nil" ,
2565
- currentSpec : map [string ]interface {} {
2571
+ currentSpec : map [string ]any {
2566
2572
"serviceName" : "test-svc" ,
2567
2573
},
2568
- desiredSpec : map [string ]interface {} {
2574
+ desiredSpec : map [string ]any {
2569
2575
"serviceName" : "test-svc" ,
2570
- "volumeClaimTemplates" : []interface {} {
2571
- map [string ]interface {} {
2572
- "metadata" : map [string ]interface {} {
2576
+ "volumeClaimTemplates" : []any {
2577
+ map [string ]any {
2578
+ "metadata" : map [string ]any {
2573
2579
"name" : "data" ,
2574
2580
},
2575
2581
},
@@ -2584,24 +2590,24 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2584
2590
},
2585
2591
{
2586
2592
name : "complex volumeClaimTemplates change" ,
2587
- currentSpec : map [string ]interface {} {
2588
- "volumeClaimTemplates" : []interface {} {
2589
- map [string ]interface {} {
2590
- "metadata" : map [string ]interface {} {
2593
+ currentSpec : map [string ]any {
2594
+ "volumeClaimTemplates" : []any {
2595
+ map [string ]any {
2596
+ "metadata" : map [string ]any {
2591
2597
"name" : "data1" ,
2592
2598
},
2593
2599
},
2594
2600
},
2595
2601
},
2596
- desiredSpec : map [string ]interface {} {
2597
- "volumeClaimTemplates" : []interface {} {
2598
- map [string ]interface {} {
2599
- "metadata" : map [string ]interface {} {
2602
+ desiredSpec : map [string ]any {
2603
+ "volumeClaimTemplates" : []any {
2604
+ map [string ]any {
2605
+ "metadata" : map [string ]any {
2600
2606
"name" : "data1" ,
2601
2607
},
2602
2608
},
2603
- map [string ]interface {} {
2604
- "metadata" : map [string ]interface {} {
2609
+ map [string ]any {
2610
+ "metadata" : map [string ]any {
2605
2611
"name" : "data2" ,
2606
2612
},
2607
2613
},
@@ -2616,27 +2622,27 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2616
2622
},
2617
2623
{
2618
2624
name : "multiple volumeClaimTemplate change" ,
2619
- currentSpec : map [string ]interface {} {
2625
+ currentSpec : map [string ]any {
2620
2626
"serviceName" : postgresqlSvc ,
2621
- "selector" : map [string ]interface {} {
2622
- "matchLabels" : map [string ]interface {} {
2627
+ "selector" : map [string ]any {
2628
+ "matchLabels" : map [string ]any {
2623
2629
"app" : "postgresql" ,
2624
2630
},
2625
2631
},
2626
- "volumeClaimTemplates" : []interface {} {
2632
+ "volumeClaimTemplates" : []any {
2627
2633
templateWithStorage (staticFiles , "1Gi" ),
2628
2634
templateWithStorage (dexconfig , "1Gi" ),
2629
2635
templateWithStorage (argocdDexServerTLS , "1Gi" ),
2630
2636
},
2631
2637
},
2632
- desiredSpec : map [string ]interface {} {
2638
+ desiredSpec : map [string ]any {
2633
2639
"serviceName" : postgresqlSvc ,
2634
- "selector" : map [string ]interface {} {
2635
- "matchLabels" : map [string ]interface {} {
2640
+ "selector" : map [string ]any {
2641
+ "matchLabels" : map [string ]any {
2636
2642
"app" : "postgresql" ,
2637
2643
},
2638
2644
},
2639
- "volumeClaimTemplates" : []interface {} {
2645
+ "volumeClaimTemplates" : []any {
2640
2646
templateWithStorage (staticFiles , "2Gi" ),
2641
2647
templateWithStorage (dexconfig , "3Gi" ),
2642
2648
templateWithStorage (argocdDexServerTLS , "4Gi" ),
@@ -2657,27 +2663,27 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2657
2663
},
2658
2664
{
2659
2665
name : "multiple field changes" ,
2660
- currentSpec : map [string ]interface {} {
2666
+ currentSpec : map [string ]any {
2661
2667
"serviceName" : postgresqlSvc ,
2662
- "selector" : map [string ]interface {} {
2663
- "matchLabels" : map [string ]interface {} {
2668
+ "selector" : map [string ]any {
2669
+ "matchLabels" : map [string ]any {
2664
2670
"app" : "postgresql" ,
2665
2671
},
2666
2672
},
2667
- "volumeClaimTemplates" : []interface {} {
2673
+ "volumeClaimTemplates" : []any {
2668
2674
templateWithStorage (staticFiles , "1Gi" ),
2669
2675
templateWithStorage (dexconfig , "1Gi" ),
2670
2676
templateWithStorage (argocdDexServerTLS , "1Gi" ),
2671
2677
},
2672
2678
},
2673
- desiredSpec : map [string ]interface {} {
2679
+ desiredSpec : map [string ]any {
2674
2680
"serviceName" : "postgresql-svc-new" ,
2675
- "selector" : map [string ]interface {} {
2676
- "matchLabels" : map [string ]interface {} {
2681
+ "selector" : map [string ]any {
2682
+ "matchLabels" : map [string ]any {
2677
2683
"app" : "postgresql-new" ,
2678
2684
},
2679
2685
},
2680
- "volumeClaimTemplates" : []interface {} {
2686
+ "volumeClaimTemplates" : []any {
2681
2687
templateWithStorage (staticFiles , "2Gi" ),
2682
2688
templateWithStorage (dexconfig , "1Gi" ),
2683
2689
templateWithStorage (argocdDexServerTLS , "1Gi" ),
@@ -2701,10 +2707,10 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2701
2707
for _, tt := range tests {
2702
2708
t .Run (tt .name , func (t * testing.T ) {
2703
2709
current := & unstructured.Unstructured {
2704
- Object : map [string ]interface {} {
2710
+ Object : map [string ]any {
2705
2711
"apiVersion" : testAPIVersion ,
2706
2712
"kind" : "StatefulSet" ,
2707
- "metadata" : map [string ]interface {} {
2713
+ "metadata" : map [string ]any {
2708
2714
"name" : testStatefulSet ,
2709
2715
"namespace" : testNamespace ,
2710
2716
},
@@ -2713,10 +2719,10 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2713
2719
}
2714
2720
2715
2721
desired := & unstructured.Unstructured {
2716
- Object : map [string ]interface {} {
2722
+ Object : map [string ]any {
2717
2723
"apiVersion" : testAPIVersion ,
2718
2724
"kind" : "StatefulSet" ,
2719
- "metadata" : map [string ]interface {} {
2725
+ "metadata" : map [string ]any {
2720
2726
"name" : testStatefulSet ,
2721
2727
"namespace" : testNamespace ,
2722
2728
},
0 commit comments