@@ -2072,14 +2072,14 @@ func TestWaitForCleanUpBeforeNextWave(t *testing.T) {
20722072 assert .Equal (t , synccommon .ResultCodePruned , result [2 ].Status )
20732073}
20742074
2075- func templateWithStorage (name , storage string ) map [string ]interface {} {
2076- return map [string ]interface {} {
2077- "metadata" : map [string ]interface {} {
2075+ func templateWithStorage (name , storage string ) map [string ]any {
2076+ return map [string ]any {
2077+ "metadata" : map [string ]any {
20782078 "name" : name ,
20792079 },
2080- "spec" : map [string ]interface {} {
2081- "resources" : map [string ]interface {} {
2082- "requests" : map [string ]interface {} {
2080+ "spec" : map [string ]any {
2081+ "resources" : map [string ]any {
2082+ "requests" : map [string ]any {
20832083 "storage" : storage ,
20842084 },
20852085 },
@@ -2090,16 +2090,16 @@ func templateWithStorage(name, storage string) map[string]interface{} {
20902090func TestStatefulSetImmutableFieldErrors (t * testing.T ) {
20912091 tests := []struct {
20922092 name string
2093- currentSpec map [string ]interface {}
2094- desiredSpec map [string ]interface {}
2093+ currentSpec map [string ]any
2094+ desiredSpec map [string ]any
20952095 expectedMessage string
20962096 }{
20972097 {
20982098 name : "single field change - serviceName" ,
2099- currentSpec : map [string ]interface {} {
2099+ currentSpec : map [string ]any {
21002100 "serviceName" : "old-svc" ,
21012101 },
2102- desiredSpec : map [string ]interface {} {
2102+ desiredSpec : map [string ]any {
21032103 "serviceName" : "new-svc" ,
21042104 },
21052105 expectedMessage : `attempting to change immutable fields:
@@ -2111,31 +2111,31 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
21112111 },
21122112 {
21132113 name : "volumeClaimTemplates change with storage size" ,
2114- currentSpec : map [string ]interface {} {
2115- "volumeClaimTemplates" : []interface {} {
2116- map [string ]interface {} {
2117- "metadata" : map [string ]interface {} {
2114+ currentSpec : map [string ]any {
2115+ "volumeClaimTemplates" : []any {
2116+ map [string ]any {
2117+ "metadata" : map [string ]any {
21182118 "name" : "data" ,
21192119 },
2120- "spec" : map [string ]interface {} {
2121- "resources" : map [string ]interface {} {
2122- "requests" : map [string ]interface {} {
2120+ "spec" : map [string ]any {
2121+ "resources" : map [string ]any {
2122+ "requests" : map [string ]any {
21232123 "storage" : "1Gi" ,
21242124 },
21252125 },
21262126 },
21272127 },
21282128 },
21292129 },
2130- desiredSpec : map [string ]interface {} {
2131- "volumeClaimTemplates" : []interface {} {
2132- map [string ]interface {} {
2133- "metadata" : map [string ]interface {} {
2130+ desiredSpec : map [string ]any {
2131+ "volumeClaimTemplates" : []any {
2132+ map [string ]any {
2133+ "metadata" : map [string ]any {
21342134 "name" : "data" ,
21352135 },
2136- "spec" : map [string ]interface {} {
2137- "resources" : map [string ]interface {} {
2138- "requests" : map [string ]interface {} {
2136+ "spec" : map [string ]any {
2137+ "resources" : map [string ]any {
2138+ "requests" : map [string ]any {
21392139 "storage" : "2Gi" ,
21402140 },
21412141 },
@@ -2152,16 +2152,16 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
21522152 },
21532153 {
21542154 name : "selector change" ,
2155- currentSpec : map [string ]interface {} {
2156- "selector" : map [string ]interface {} {
2157- "matchLabels" : map [string ]interface {} {
2155+ currentSpec : map [string ]any {
2156+ "selector" : map [string ]any {
2157+ "matchLabels" : map [string ]any {
21582158 "app" : "old-app" ,
21592159 },
21602160 },
21612161 },
2162- desiredSpec : map [string ]interface {} {
2163- "selector" : map [string ]interface {} {
2164- "matchLabels" : map [string ]interface {} {
2162+ desiredSpec : map [string ]any {
2163+ "selector" : map [string ]any {
2164+ "matchLabels" : map [string ]any {
21652165 "app" : "new-app" ,
21662166 },
21672167 },
@@ -2175,14 +2175,14 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
21752175 },
21762176 {
21772177 name : "volumeClaimTemplates change from nil" ,
2178- currentSpec : map [string ]interface {} {
2178+ currentSpec : map [string ]any {
21792179 "serviceName" : "test-svc" ,
21802180 },
2181- desiredSpec : map [string ]interface {} {
2181+ desiredSpec : map [string ]any {
21822182 "serviceName" : "test-svc" ,
2183- "volumeClaimTemplates" : []interface {} {
2184- map [string ]interface {} {
2185- "metadata" : map [string ]interface {} {
2183+ "volumeClaimTemplates" : []any {
2184+ map [string ]any {
2185+ "metadata" : map [string ]any {
21862186 "name" : "data" ,
21872187 },
21882188 },
@@ -2197,24 +2197,24 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
21972197 },
21982198 {
21992199 name : "complex volumeClaimTemplates change" ,
2200- currentSpec : map [string ]interface {} {
2201- "volumeClaimTemplates" : []interface {} {
2202- map [string ]interface {} {
2203- "metadata" : map [string ]interface {} {
2200+ currentSpec : map [string ]any {
2201+ "volumeClaimTemplates" : []any {
2202+ map [string ]any {
2203+ "metadata" : map [string ]any {
22042204 "name" : "data1" ,
22052205 },
22062206 },
22072207 },
22082208 },
2209- desiredSpec : map [string ]interface {} {
2210- "volumeClaimTemplates" : []interface {} {
2211- map [string ]interface {} {
2212- "metadata" : map [string ]interface {} {
2209+ desiredSpec : map [string ]any {
2210+ "volumeClaimTemplates" : []any {
2211+ map [string ]any {
2212+ "metadata" : map [string ]any {
22132213 "name" : "data1" ,
22142214 },
22152215 },
2216- map [string ]interface {} {
2217- "metadata" : map [string ]interface {} {
2216+ map [string ]any {
2217+ "metadata" : map [string ]any {
22182218 "name" : "data2" ,
22192219 },
22202220 },
@@ -2229,27 +2229,27 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
22292229 },
22302230 {
22312231 name : "multiple volumeClaimTemplate change" ,
2232- currentSpec : map [string ]interface {} {
2232+ currentSpec : map [string ]any {
22332233 "serviceName" : postgresqlSvc ,
2234- "selector" : map [string ]interface {} {
2235- "matchLabels" : map [string ]interface {} {
2234+ "selector" : map [string ]any {
2235+ "matchLabels" : map [string ]any {
22362236 "app" : "postgresql" ,
22372237 },
22382238 },
2239- "volumeClaimTemplates" : []interface {} {
2239+ "volumeClaimTemplates" : []any {
22402240 templateWithStorage (staticFiles , "1Gi" ),
22412241 templateWithStorage (dexconfig , "1Gi" ),
22422242 templateWithStorage (argocdDexServerTLS , "1Gi" ),
22432243 },
22442244 },
2245- desiredSpec : map [string ]interface {} {
2245+ desiredSpec : map [string ]any {
22462246 "serviceName" : postgresqlSvc ,
2247- "selector" : map [string ]interface {} {
2248- "matchLabels" : map [string ]interface {} {
2247+ "selector" : map [string ]any {
2248+ "matchLabels" : map [string ]any {
22492249 "app" : "postgresql" ,
22502250 },
22512251 },
2252- "volumeClaimTemplates" : []interface {} {
2252+ "volumeClaimTemplates" : []any {
22532253 templateWithStorage (staticFiles , "2Gi" ),
22542254 templateWithStorage (dexconfig , "3Gi" ),
22552255 templateWithStorage (argocdDexServerTLS , "4Gi" ),
@@ -2270,27 +2270,27 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
22702270 },
22712271 {
22722272 name : "multiple field changes" ,
2273- currentSpec : map [string ]interface {} {
2273+ currentSpec : map [string ]any {
22742274 "serviceName" : postgresqlSvc ,
2275- "selector" : map [string ]interface {} {
2276- "matchLabels" : map [string ]interface {} {
2275+ "selector" : map [string ]any {
2276+ "matchLabels" : map [string ]any {
22772277 "app" : "postgresql" ,
22782278 },
22792279 },
2280- "volumeClaimTemplates" : []interface {} {
2280+ "volumeClaimTemplates" : []any {
22812281 templateWithStorage (staticFiles , "1Gi" ),
22822282 templateWithStorage (dexconfig , "1Gi" ),
22832283 templateWithStorage (argocdDexServerTLS , "1Gi" ),
22842284 },
22852285 },
2286- desiredSpec : map [string ]interface {} {
2286+ desiredSpec : map [string ]any {
22872287 "serviceName" : "postgresql-svc-new" ,
2288- "selector" : map [string ]interface {} {
2289- "matchLabels" : map [string ]interface {} {
2288+ "selector" : map [string ]any {
2289+ "matchLabels" : map [string ]any {
22902290 "app" : "postgresql-new" ,
22912291 },
22922292 },
2293- "volumeClaimTemplates" : []interface {} {
2293+ "volumeClaimTemplates" : []any {
22942294 templateWithStorage (staticFiles , "2Gi" ),
22952295 templateWithStorage (dexconfig , "1Gi" ),
22962296 templateWithStorage (argocdDexServerTLS , "1Gi" ),
@@ -2314,10 +2314,10 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
23142314 for _ , tt := range tests {
23152315 t .Run (tt .name , func (t * testing.T ) {
23162316 current := & unstructured.Unstructured {
2317- Object : map [string ]interface {} {
2317+ Object : map [string ]any {
23182318 "apiVersion" : testAPIVersion ,
23192319 "kind" : "StatefulSet" ,
2320- "metadata" : map [string ]interface {} {
2320+ "metadata" : map [string ]any {
23212321 "name" : testStatefulSet ,
23222322 "namespace" : testNamespace ,
23232323 },
@@ -2326,10 +2326,10 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
23262326 }
23272327
23282328 desired := & unstructured.Unstructured {
2329- Object : map [string ]interface {} {
2329+ Object : map [string ]any {
23302330 "apiVersion" : testAPIVersion ,
23312331 "kind" : "StatefulSet" ,
2332- "metadata" : map [string ]interface {} {
2332+ "metadata" : map [string ]any {
23332333 "name" : testStatefulSet ,
23342334 "namespace" : testNamespace ,
23352335 },
0 commit comments