@@ -2272,14 +2272,14 @@ func TestNeedsClientSideApplyMigration(t *testing.T) {
22722272 }
22732273}
22742274
2275- func templateWithStorage (name , storage string ) map [string ]interface {} {
2276- return map [string ]interface {} {
2277- "metadata" : map [string ]interface {} {
2275+ func templateWithStorage (name , storage string ) map [string ]any {
2276+ return map [string ]any {
2277+ "metadata" : map [string ]any {
22782278 "name" : name ,
22792279 },
2280- "spec" : map [string ]interface {} {
2281- "resources" : map [string ]interface {} {
2282- "requests" : map [string ]interface {} {
2280+ "spec" : map [string ]any {
2281+ "resources" : map [string ]any {
2282+ "requests" : map [string ]any {
22832283 "storage" : storage ,
22842284 },
22852285 },
@@ -2290,16 +2290,16 @@ func templateWithStorage(name, storage string) map[string]interface{} {
22902290func TestStatefulSetImmutableFieldErrors (t * testing.T ) {
22912291 tests := []struct {
22922292 name string
2293- currentSpec map [string ]interface {}
2294- desiredSpec map [string ]interface {}
2293+ currentSpec map [string ]any
2294+ desiredSpec map [string ]any
22952295 expectedMessage string
22962296 }{
22972297 {
22982298 name : "single field change - serviceName" ,
2299- currentSpec : map [string ]interface {} {
2299+ currentSpec : map [string ]any {
23002300 "serviceName" : "old-svc" ,
23012301 },
2302- desiredSpec : map [string ]interface {} {
2302+ desiredSpec : map [string ]any {
23032303 "serviceName" : "new-svc" ,
23042304 },
23052305 expectedMessage : `attempting to change immutable fields:
@@ -2311,31 +2311,31 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
23112311 },
23122312 {
23132313 name : "volumeClaimTemplates change with storage size" ,
2314- currentSpec : map [string ]interface {} {
2315- "volumeClaimTemplates" : []interface {} {
2316- map [string ]interface {} {
2317- "metadata" : map [string ]interface {} {
2314+ currentSpec : map [string ]any {
2315+ "volumeClaimTemplates" : []any {
2316+ map [string ]any {
2317+ "metadata" : map [string ]any {
23182318 "name" : "data" ,
23192319 },
2320- "spec" : map [string ]interface {} {
2321- "resources" : map [string ]interface {} {
2322- "requests" : map [string ]interface {} {
2320+ "spec" : map [string ]any {
2321+ "resources" : map [string ]any {
2322+ "requests" : map [string ]any {
23232323 "storage" : "1Gi" ,
23242324 },
23252325 },
23262326 },
23272327 },
23282328 },
23292329 },
2330- desiredSpec : map [string ]interface {} {
2331- "volumeClaimTemplates" : []interface {} {
2332- map [string ]interface {} {
2333- "metadata" : map [string ]interface {} {
2330+ desiredSpec : map [string ]any {
2331+ "volumeClaimTemplates" : []any {
2332+ map [string ]any {
2333+ "metadata" : map [string ]any {
23342334 "name" : "data" ,
23352335 },
2336- "spec" : map [string ]interface {} {
2337- "resources" : map [string ]interface {} {
2338- "requests" : map [string ]interface {} {
2336+ "spec" : map [string ]any {
2337+ "resources" : map [string ]any {
2338+ "requests" : map [string ]any {
23392339 "storage" : "2Gi" ,
23402340 },
23412341 },
@@ -2352,16 +2352,16 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
23522352 },
23532353 {
23542354 name : "selector change" ,
2355- currentSpec : map [string ]interface {} {
2356- "selector" : map [string ]interface {} {
2357- "matchLabels" : map [string ]interface {} {
2355+ currentSpec : map [string ]any {
2356+ "selector" : map [string ]any {
2357+ "matchLabels" : map [string ]any {
23582358 "app" : "old-app" ,
23592359 },
23602360 },
23612361 },
2362- desiredSpec : map [string ]interface {} {
2363- "selector" : map [string ]interface {} {
2364- "matchLabels" : map [string ]interface {} {
2362+ desiredSpec : map [string ]any {
2363+ "selector" : map [string ]any {
2364+ "matchLabels" : map [string ]any {
23652365 "app" : "new-app" ,
23662366 },
23672367 },
@@ -2375,14 +2375,14 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
23752375 },
23762376 {
23772377 name : "volumeClaimTemplates change from nil" ,
2378- currentSpec : map [string ]interface {} {
2378+ currentSpec : map [string ]any {
23792379 "serviceName" : "test-svc" ,
23802380 },
2381- desiredSpec : map [string ]interface {} {
2381+ desiredSpec : map [string ]any {
23822382 "serviceName" : "test-svc" ,
2383- "volumeClaimTemplates" : []interface {} {
2384- map [string ]interface {} {
2385- "metadata" : map [string ]interface {} {
2383+ "volumeClaimTemplates" : []any {
2384+ map [string ]any {
2385+ "metadata" : map [string ]any {
23862386 "name" : "data" ,
23872387 },
23882388 },
@@ -2397,24 +2397,24 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
23972397 },
23982398 {
23992399 name : "complex volumeClaimTemplates change" ,
2400- currentSpec : map [string ]interface {} {
2401- "volumeClaimTemplates" : []interface {} {
2402- map [string ]interface {} {
2403- "metadata" : map [string ]interface {} {
2400+ currentSpec : map [string ]any {
2401+ "volumeClaimTemplates" : []any {
2402+ map [string ]any {
2403+ "metadata" : map [string ]any {
24042404 "name" : "data1" ,
24052405 },
24062406 },
24072407 },
24082408 },
2409- desiredSpec : map [string ]interface {} {
2410- "volumeClaimTemplates" : []interface {} {
2411- map [string ]interface {} {
2412- "metadata" : map [string ]interface {} {
2409+ desiredSpec : map [string ]any {
2410+ "volumeClaimTemplates" : []any {
2411+ map [string ]any {
2412+ "metadata" : map [string ]any {
24132413 "name" : "data1" ,
24142414 },
24152415 },
2416- map [string ]interface {} {
2417- "metadata" : map [string ]interface {} {
2416+ map [string ]any {
2417+ "metadata" : map [string ]any {
24182418 "name" : "data2" ,
24192419 },
24202420 },
@@ -2429,27 +2429,27 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
24292429 },
24302430 {
24312431 name : "multiple volumeClaimTemplate change" ,
2432- currentSpec : map [string ]interface {} {
2432+ currentSpec : map [string ]any {
24332433 "serviceName" : postgresqlSvc ,
2434- "selector" : map [string ]interface {} {
2435- "matchLabels" : map [string ]interface {} {
2434+ "selector" : map [string ]any {
2435+ "matchLabels" : map [string ]any {
24362436 "app" : "postgresql" ,
24372437 },
24382438 },
2439- "volumeClaimTemplates" : []interface {} {
2439+ "volumeClaimTemplates" : []any {
24402440 templateWithStorage (staticFiles , "1Gi" ),
24412441 templateWithStorage (dexconfig , "1Gi" ),
24422442 templateWithStorage (argocdDexServerTLS , "1Gi" ),
24432443 },
24442444 },
2445- desiredSpec : map [string ]interface {} {
2445+ desiredSpec : map [string ]any {
24462446 "serviceName" : postgresqlSvc ,
2447- "selector" : map [string ]interface {} {
2448- "matchLabels" : map [string ]interface {} {
2447+ "selector" : map [string ]any {
2448+ "matchLabels" : map [string ]any {
24492449 "app" : "postgresql" ,
24502450 },
24512451 },
2452- "volumeClaimTemplates" : []interface {} {
2452+ "volumeClaimTemplates" : []any {
24532453 templateWithStorage (staticFiles , "2Gi" ),
24542454 templateWithStorage (dexconfig , "3Gi" ),
24552455 templateWithStorage (argocdDexServerTLS , "4Gi" ),
@@ -2470,27 +2470,27 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
24702470 },
24712471 {
24722472 name : "multiple field changes" ,
2473- currentSpec : map [string ]interface {} {
2473+ currentSpec : map [string ]any {
24742474 "serviceName" : postgresqlSvc ,
2475- "selector" : map [string ]interface {} {
2476- "matchLabels" : map [string ]interface {} {
2475+ "selector" : map [string ]any {
2476+ "matchLabels" : map [string ]any {
24772477 "app" : "postgresql" ,
24782478 },
24792479 },
2480- "volumeClaimTemplates" : []interface {} {
2480+ "volumeClaimTemplates" : []any {
24812481 templateWithStorage (staticFiles , "1Gi" ),
24822482 templateWithStorage (dexconfig , "1Gi" ),
24832483 templateWithStorage (argocdDexServerTLS , "1Gi" ),
24842484 },
24852485 },
2486- desiredSpec : map [string ]interface {} {
2486+ desiredSpec : map [string ]any {
24872487 "serviceName" : "postgresql-svc-new" ,
2488- "selector" : map [string ]interface {} {
2489- "matchLabels" : map [string ]interface {} {
2488+ "selector" : map [string ]any {
2489+ "matchLabels" : map [string ]any {
24902490 "app" : "postgresql-new" ,
24912491 },
24922492 },
2493- "volumeClaimTemplates" : []interface {} {
2493+ "volumeClaimTemplates" : []any {
24942494 templateWithStorage (staticFiles , "2Gi" ),
24952495 templateWithStorage (dexconfig , "1Gi" ),
24962496 templateWithStorage (argocdDexServerTLS , "1Gi" ),
@@ -2514,10 +2514,10 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
25142514 for _ , tt := range tests {
25152515 t .Run (tt .name , func (t * testing.T ) {
25162516 current := & unstructured.Unstructured {
2517- Object : map [string ]interface {} {
2517+ Object : map [string ]any {
25182518 "apiVersion" : testAPIVersion ,
25192519 "kind" : "StatefulSet" ,
2520- "metadata" : map [string ]interface {} {
2520+ "metadata" : map [string ]any {
25212521 "name" : testStatefulSet ,
25222522 "namespace" : testNamespace ,
25232523 },
@@ -2526,10 +2526,10 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
25262526 }
25272527
25282528 desired := & unstructured.Unstructured {
2529- Object : map [string ]interface {} {
2529+ Object : map [string ]any {
25302530 "apiVersion" : testAPIVersion ,
25312531 "kind" : "StatefulSet" ,
2532- "metadata" : map [string ]interface {} {
2532+ "metadata" : map [string ]any {
25332533 "name" : testStatefulSet ,
25342534 "namespace" : testNamespace ,
25352535 },
0 commit comments