@@ -39,9 +39,13 @@ import (
39
39
)
40
40
41
41
const (
42
- testAPIVersion = "apps/v1"
43
- testStatefulSet = "test-statefulset"
44
- testNamespace = "default"
42
+ testAPIVersion = "apps/v1"
43
+ testStatefulSet = "test-statefulset"
44
+ testNamespace = "default"
45
+ staticFiles = "static-files"
46
+ argocdDexServerTLS = "argocd-dex-server-tls"
47
+ postgresqlSvc = "postgresql-svc"
48
+ dexconfig = "dexconfig"
45
49
)
46
50
47
51
var standardVerbs = v1.Verbs {"create" , "delete" , "deletecollection" , "get" , "list" , "patch" , "update" , "watch" }
@@ -2204,29 +2208,29 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2204
2208
{
2205
2209
name : "multiple volumeClaimTemplate change" ,
2206
2210
currentSpec : map [string ]interface {}{
2207
- "serviceName" : "postgresql-svc" ,
2211
+ "serviceName" : postgresqlSvc ,
2208
2212
"selector" : map [string ]interface {}{
2209
2213
"matchLabels" : map [string ]interface {}{
2210
2214
"app" : "postgresql" ,
2211
2215
},
2212
2216
},
2213
2217
"volumeClaimTemplates" : []interface {}{
2214
- templateWithStorage ("static-files" , "1Gi" ),
2215
- templateWithStorage (" dexconfig" , "1Gi" ),
2216
- templateWithStorage ("argocd-dex-server-tls" , "1Gi" ),
2218
+ templateWithStorage (staticFiles , "1Gi" ),
2219
+ templateWithStorage (dexconfig , "1Gi" ),
2220
+ templateWithStorage (argocdDexServerTLS , "1Gi" ),
2217
2221
},
2218
2222
},
2219
2223
desiredSpec : map [string ]interface {}{
2220
- "serviceName" : "postgresql-svc" ,
2224
+ "serviceName" : postgresqlSvc ,
2221
2225
"selector" : map [string ]interface {}{
2222
2226
"matchLabels" : map [string ]interface {}{
2223
2227
"app" : "postgresql" ,
2224
2228
},
2225
2229
},
2226
2230
"volumeClaimTemplates" : []interface {}{
2227
- templateWithStorage ("static-files" , "2Gi" ),
2228
- templateWithStorage (" dexconfig" , "3Gi" ),
2229
- templateWithStorage ("argocd-dex-server-tls" , "4Gi" ),
2231
+ templateWithStorage (staticFiles , "2Gi" ),
2232
+ templateWithStorage (dexconfig , "3Gi" ),
2233
+ templateWithStorage (argocdDexServerTLS , "4Gi" ),
2230
2234
},
2231
2235
},
2232
2236
expectedMessage : `attempting to change immutable fields:
@@ -2245,16 +2249,16 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2245
2249
{
2246
2250
name : "multiple field changes" ,
2247
2251
currentSpec : map [string ]interface {}{
2248
- "serviceName" : "postgresql-svc" ,
2252
+ "serviceName" : postgresqlSvc ,
2249
2253
"selector" : map [string ]interface {}{
2250
2254
"matchLabels" : map [string ]interface {}{
2251
2255
"app" : "postgresql" ,
2252
2256
},
2253
2257
},
2254
2258
"volumeClaimTemplates" : []interface {}{
2255
- templateWithStorage ("static-files" , "1Gi" ),
2256
- templateWithStorage (" dexconfig" , "1Gi" ),
2257
- templateWithStorage ("argocd-dex-server-tls" , "1Gi" ),
2259
+ templateWithStorage (staticFiles , "1Gi" ),
2260
+ templateWithStorage (dexconfig , "1Gi" ),
2261
+ templateWithStorage (argocdDexServerTLS , "1Gi" ),
2258
2262
},
2259
2263
},
2260
2264
desiredSpec : map [string ]interface {}{
@@ -2265,9 +2269,9 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2265
2269
},
2266
2270
},
2267
2271
"volumeClaimTemplates" : []interface {}{
2268
- templateWithStorage ("static-files" , "2Gi" ),
2269
- templateWithStorage (" dexconfig" , "1Gi" ),
2270
- templateWithStorage ("argocd-dex-server-tls" , "1Gi" ),
2272
+ templateWithStorage (staticFiles , "2Gi" ),
2273
+ templateWithStorage (dexconfig , "1Gi" ),
2274
+ templateWithStorage (argocdDexServerTLS , "1Gi" ),
2271
2275
},
2272
2276
},
2273
2277
expectedMessage : `attempting to change immutable fields:
0 commit comments