@@ -2072,14 +2072,14 @@ func TestWaitForCleanUpBeforeNextWave(t *testing.T) {
2072
2072
assert .Equal (t , synccommon .ResultCodePruned , result [2 ].Status )
2073
2073
}
2074
2074
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 {
2078
2078
"name" : name ,
2079
2079
},
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 {
2083
2083
"storage" : storage ,
2084
2084
},
2085
2085
},
@@ -2090,16 +2090,16 @@ func templateWithStorage(name, storage string) map[string]interface{} {
2090
2090
func TestStatefulSetImmutableFieldErrors (t * testing.T ) {
2091
2091
tests := []struct {
2092
2092
name string
2093
- currentSpec map [string ]interface {}
2094
- desiredSpec map [string ]interface {}
2093
+ currentSpec map [string ]any
2094
+ desiredSpec map [string ]any
2095
2095
expectedMessage string
2096
2096
}{
2097
2097
{
2098
2098
name : "single field change - serviceName" ,
2099
- currentSpec : map [string ]interface {} {
2099
+ currentSpec : map [string ]any {
2100
2100
"serviceName" : "old-svc" ,
2101
2101
},
2102
- desiredSpec : map [string ]interface {} {
2102
+ desiredSpec : map [string ]any {
2103
2103
"serviceName" : "new-svc" ,
2104
2104
},
2105
2105
expectedMessage : `attempting to change immutable fields:
@@ -2111,31 +2111,31 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2111
2111
},
2112
2112
{
2113
2113
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 {
2118
2118
"name" : "data" ,
2119
2119
},
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 {
2123
2123
"storage" : "1Gi" ,
2124
2124
},
2125
2125
},
2126
2126
},
2127
2127
},
2128
2128
},
2129
2129
},
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 {
2134
2134
"name" : "data" ,
2135
2135
},
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 {
2139
2139
"storage" : "2Gi" ,
2140
2140
},
2141
2141
},
@@ -2152,16 +2152,16 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2152
2152
},
2153
2153
{
2154
2154
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 {
2158
2158
"app" : "old-app" ,
2159
2159
},
2160
2160
},
2161
2161
},
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 {
2165
2165
"app" : "new-app" ,
2166
2166
},
2167
2167
},
@@ -2175,14 +2175,14 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2175
2175
},
2176
2176
{
2177
2177
name : "volumeClaimTemplates change from nil" ,
2178
- currentSpec : map [string ]interface {} {
2178
+ currentSpec : map [string ]any {
2179
2179
"serviceName" : "test-svc" ,
2180
2180
},
2181
- desiredSpec : map [string ]interface {} {
2181
+ desiredSpec : map [string ]any {
2182
2182
"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 {
2186
2186
"name" : "data" ,
2187
2187
},
2188
2188
},
@@ -2197,24 +2197,24 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2197
2197
},
2198
2198
{
2199
2199
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 {
2204
2204
"name" : "data1" ,
2205
2205
},
2206
2206
},
2207
2207
},
2208
2208
},
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 {
2213
2213
"name" : "data1" ,
2214
2214
},
2215
2215
},
2216
- map [string ]interface {} {
2217
- "metadata" : map [string ]interface {} {
2216
+ map [string ]any {
2217
+ "metadata" : map [string ]any {
2218
2218
"name" : "data2" ,
2219
2219
},
2220
2220
},
@@ -2229,27 +2229,27 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2229
2229
},
2230
2230
{
2231
2231
name : "multiple volumeClaimTemplate change" ,
2232
- currentSpec : map [string ]interface {} {
2232
+ currentSpec : map [string ]any {
2233
2233
"serviceName" : postgresqlSvc ,
2234
- "selector" : map [string ]interface {} {
2235
- "matchLabels" : map [string ]interface {} {
2234
+ "selector" : map [string ]any {
2235
+ "matchLabels" : map [string ]any {
2236
2236
"app" : "postgresql" ,
2237
2237
},
2238
2238
},
2239
- "volumeClaimTemplates" : []interface {} {
2239
+ "volumeClaimTemplates" : []any {
2240
2240
templateWithStorage (staticFiles , "1Gi" ),
2241
2241
templateWithStorage (dexconfig , "1Gi" ),
2242
2242
templateWithStorage (argocdDexServerTLS , "1Gi" ),
2243
2243
},
2244
2244
},
2245
- desiredSpec : map [string ]interface {} {
2245
+ desiredSpec : map [string ]any {
2246
2246
"serviceName" : postgresqlSvc ,
2247
- "selector" : map [string ]interface {} {
2248
- "matchLabels" : map [string ]interface {} {
2247
+ "selector" : map [string ]any {
2248
+ "matchLabels" : map [string ]any {
2249
2249
"app" : "postgresql" ,
2250
2250
},
2251
2251
},
2252
- "volumeClaimTemplates" : []interface {} {
2252
+ "volumeClaimTemplates" : []any {
2253
2253
templateWithStorage (staticFiles , "2Gi" ),
2254
2254
templateWithStorage (dexconfig , "3Gi" ),
2255
2255
templateWithStorage (argocdDexServerTLS , "4Gi" ),
@@ -2270,27 +2270,27 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2270
2270
},
2271
2271
{
2272
2272
name : "multiple field changes" ,
2273
- currentSpec : map [string ]interface {} {
2273
+ currentSpec : map [string ]any {
2274
2274
"serviceName" : postgresqlSvc ,
2275
- "selector" : map [string ]interface {} {
2276
- "matchLabels" : map [string ]interface {} {
2275
+ "selector" : map [string ]any {
2276
+ "matchLabels" : map [string ]any {
2277
2277
"app" : "postgresql" ,
2278
2278
},
2279
2279
},
2280
- "volumeClaimTemplates" : []interface {} {
2280
+ "volumeClaimTemplates" : []any {
2281
2281
templateWithStorage (staticFiles , "1Gi" ),
2282
2282
templateWithStorage (dexconfig , "1Gi" ),
2283
2283
templateWithStorage (argocdDexServerTLS , "1Gi" ),
2284
2284
},
2285
2285
},
2286
- desiredSpec : map [string ]interface {} {
2286
+ desiredSpec : map [string ]any {
2287
2287
"serviceName" : "postgresql-svc-new" ,
2288
- "selector" : map [string ]interface {} {
2289
- "matchLabels" : map [string ]interface {} {
2288
+ "selector" : map [string ]any {
2289
+ "matchLabels" : map [string ]any {
2290
2290
"app" : "postgresql-new" ,
2291
2291
},
2292
2292
},
2293
- "volumeClaimTemplates" : []interface {} {
2293
+ "volumeClaimTemplates" : []any {
2294
2294
templateWithStorage (staticFiles , "2Gi" ),
2295
2295
templateWithStorage (dexconfig , "1Gi" ),
2296
2296
templateWithStorage (argocdDexServerTLS , "1Gi" ),
@@ -2314,10 +2314,10 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2314
2314
for _ , tt := range tests {
2315
2315
t .Run (tt .name , func (t * testing.T ) {
2316
2316
current := & unstructured.Unstructured {
2317
- Object : map [string ]interface {} {
2317
+ Object : map [string ]any {
2318
2318
"apiVersion" : testAPIVersion ,
2319
2319
"kind" : "StatefulSet" ,
2320
- "metadata" : map [string ]interface {} {
2320
+ "metadata" : map [string ]any {
2321
2321
"name" : testStatefulSet ,
2322
2322
"namespace" : testNamespace ,
2323
2323
},
@@ -2326,10 +2326,10 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2326
2326
}
2327
2327
2328
2328
desired := & unstructured.Unstructured {
2329
- Object : map [string ]interface {} {
2329
+ Object : map [string ]any {
2330
2330
"apiVersion" : testAPIVersion ,
2331
2331
"kind" : "StatefulSet" ,
2332
- "metadata" : map [string ]interface {} {
2332
+ "metadata" : map [string ]any {
2333
2333
"name" : testStatefulSet ,
2334
2334
"namespace" : testNamespace ,
2335
2335
},
0 commit comments