You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden`,
2066
2066
},
2067
2067
{
2068
-
name: "volumeClaimTemplates change from nil",
2068
+
name: "volumeClaimTemplates change with storage size",
2069
2069
currentSpec: map[string]interface{}{
2070
-
"serviceName": "test-svc",
2070
+
"volumeClaimTemplates": []interface{}{
2071
+
map[string]interface{}{
2072
+
"metadata": map[string]interface{}{
2073
+
"name": "data",
2074
+
},
2075
+
"spec": map[string]interface{}{
2076
+
"resources": map[string]interface{}{
2077
+
"requests": map[string]interface{}{
2078
+
"storage": "1Gi",
2079
+
},
2080
+
},
2081
+
},
2082
+
},
2083
+
},
2071
2084
},
2072
2085
desiredSpec: map[string]interface{}{
2073
-
"serviceName": "test-svc",
2074
2086
"volumeClaimTemplates": []interface{}{
2075
2087
map[string]interface{}{
2076
2088
"metadata": map[string]interface{}{
2077
2089
"name": "data",
2078
2090
},
2091
+
"spec": map[string]interface{}{
2092
+
"resources": map[string]interface{}{
2093
+
"requests": map[string]interface{}{
2094
+
"storage": "2Gi",
2095
+
},
2096
+
},
2097
+
},
2079
2098
},
2080
2099
},
2081
2100
},
2082
2101
expectedMessage: `one or more objects failed to apply, reason: attempting to change immutable fields:
2083
2102
- volumeClaimTemplates:
2084
-
from: <nil>
2085
-
to: templates: [data]
2103
+
from: [data(1Gi)]
2104
+
to: [data(2Gi)]
2086
2105
2087
2106
Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden`,
2088
2107
},
2089
2108
{
2090
-
name: "multiple immutable field changes",
2109
+
name: "selector change",
2091
2110
currentSpec: map[string]interface{}{
2092
-
"serviceName": "old-svc",
2093
-
"podManagementPolicy": "OrderedReady",
2111
+
"selector": map[string]interface{}{
2112
+
"matchLabels": map[string]interface{}{
2113
+
"app": "old-app",
2114
+
},
2115
+
},
2094
2116
},
2095
2117
desiredSpec: map[string]interface{}{
2096
-
"serviceName": "new-svc",
2097
-
"podManagementPolicy": "Parallel",
2118
+
"selector": map[string]interface{}{
2119
+
"matchLabels": map[string]interface{}{
2120
+
"app": "new-app",
2121
+
},
2122
+
},
2098
2123
},
2099
2124
expectedMessage: `one or more objects failed to apply, reason: attempting to change immutable fields:
2100
-
- podManagementPolicy:
2101
-
from: "OrderedReady"
2102
-
to: "Parallel"
2103
-
- serviceName:
2104
-
from: "old-svc"
2105
-
to: "new-svc"
2125
+
- selector:
2126
+
from: map[matchLabels:map[app:old-app]]
2127
+
to: map[matchLabels:map[app:new-app]]
2128
+
2129
+
Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden`,
2130
+
},
2131
+
{
2132
+
name: "volumeClaimTemplates change from nil",
2133
+
currentSpec: map[string]interface{}{
2134
+
"serviceName": "test-svc",
2135
+
},
2136
+
desiredSpec: map[string]interface{}{
2137
+
"serviceName": "test-svc",
2138
+
"volumeClaimTemplates": []interface{}{
2139
+
map[string]interface{}{
2140
+
"metadata": map[string]interface{}{
2141
+
"name": "data",
2142
+
},
2143
+
},
2144
+
},
2145
+
},
2146
+
expectedMessage: `one or more objects failed to apply, reason: attempting to change immutable fields:
2147
+
- volumeClaimTemplates:
2148
+
from: <nil>
2149
+
to: [data]
2106
2150
2107
2151
Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden`,
2108
2152
},
@@ -2133,8 +2177,28 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
2133
2177
},
2134
2178
expectedMessage: `one or more objects failed to apply, reason: attempting to change immutable fields:
2135
2179
- volumeClaimTemplates:
2136
-
from: templates: [data1]
2137
-
to: templates: [data1, data2]
2180
+
from: [data1]
2181
+
to: [data1, data2]
2182
+
2183
+
Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden`,
2184
+
},
2185
+
{
2186
+
name: "multiple immutable field changes",
2187
+
currentSpec: map[string]interface{}{
2188
+
"serviceName": "old-svc",
2189
+
"podManagementPolicy": "OrderedReady",
2190
+
},
2191
+
desiredSpec: map[string]interface{}{
2192
+
"serviceName": "new-svc",
2193
+
"podManagementPolicy": "Parallel",
2194
+
},
2195
+
expectedMessage: `one or more objects failed to apply, reason: attempting to change immutable fields:
2196
+
- podManagementPolicy:
2197
+
from: "OrderedReady"
2198
+
to: "Parallel"
2199
+
- serviceName:
2200
+
from: "old-svc"
2201
+
to: "new-svc"
2138
2202
2139
2203
Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden`,
2140
2204
},
@@ -2184,6 +2248,8 @@ Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordina
0 commit comments