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
returnfmt.Errorf("unexpected UpdateMode value %s", *mode)
123
125
}
126
+
if (*mode==vpa_types.UpdateModeInPlaceOrRecreate) &&!features.Enabled(features.InPlaceOrRecreate) &&isCreate {
127
+
returnfmt.Errorf("in order to use UpdateMode %s, you must enable feature gate %s in the admission-controller args", vpa_types.UpdateModeInPlaceOrRecreate, features.InPlaceOrRecreate)
expectError: fmt.Errorf("unexpected UpdateMode value bad"),
80
85
},
86
+
{
87
+
name: "creating VPA with InPlaceOrRecreate update mode not allowed by disabled feature gate",
88
+
vpa: vpa_types.VerticalPodAutoscaler{
89
+
Spec: vpa_types.VerticalPodAutoscalerSpec{
90
+
UpdatePolicy: &vpa_types.PodUpdatePolicy{
91
+
UpdateMode: &inPlaceOrRecreateUpdateMode,
92
+
},
93
+
},
94
+
},
95
+
isCreate: true,
96
+
inPlaceOrRecreateFeatureGateDisabled: true,
97
+
expectError: fmt.Errorf("in order to use UpdateMode %s, you must enable feature gate %s in the admission-controller args", vpa_types.UpdateModeInPlaceOrRecreate, features.InPlaceOrRecreate),
98
+
},
99
+
{
100
+
name: "updating VPA with InPlaceOrRecreate update mode allowed by disabled feature gate",
101
+
vpa: vpa_types.VerticalPodAutoscaler{
102
+
Spec: vpa_types.VerticalPodAutoscalerSpec{
103
+
UpdatePolicy: &vpa_types.PodUpdatePolicy{
104
+
UpdateMode: &inPlaceOrRecreateUpdateMode,
105
+
},
106
+
},
107
+
},
108
+
isCreate: false,
109
+
inPlaceOrRecreateFeatureGateDisabled: true,
110
+
expectError: nil,
111
+
},
112
+
{
113
+
name: "InPlaceOrRecreate update mode enabled by feature gate",
0 commit comments