Skip to content

Commit e11cb50

Browse files
committed
revert unit test
Signed-off-by: Omer Aplatony <[email protected]>
1 parent 8eaaa54 commit e11cb50

File tree

1 file changed

+19
-0
lines changed
  • vertical-pod-autoscaler/pkg/admission-controller/resource/vpa

1 file changed

+19
-0
lines changed

vertical-pod-autoscaler/pkg/admission-controller/resource/vpa/handler_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ func TestValidateVPA(t *testing.T) {
3737
badScalingMode := vpa_types.ContainerScalingMode("bad")
3838
badCPUResource := resource.MustParse("187500u")
3939
validScalingMode := vpa_types.ContainerScalingModeAuto
40+
scalingModeOff := vpa_types.ContainerScalingModeOff
41+
controlledValuesRequestsAndLimits := vpa_types.ContainerControlledValuesRequestsAndLimits
4042
tests := []struct {
4143
name string
4244
vpa vpa_types.VerticalPodAutoscaler
@@ -164,6 +166,23 @@ func TestValidateVPA(t *testing.T) {
164166
},
165167
expectError: fmt.Errorf("MaxAllowed: Memory [%v] must be a whole number of bytes", resource.MustParse("500m")),
166168
},
169+
{
170+
name: "scaling off with controlled values requests and limits",
171+
vpa: vpa_types.VerticalPodAutoscaler{
172+
Spec: vpa_types.VerticalPodAutoscalerSpec{
173+
ResourcePolicy: &vpa_types.PodResourcePolicy{
174+
ContainerPolicies: []vpa_types.ContainerResourcePolicy{
175+
{
176+
ContainerName: "loot box",
177+
Mode: &scalingModeOff,
178+
ControlledValues: &controlledValuesRequestsAndLimits,
179+
},
180+
},
181+
},
182+
},
183+
},
184+
expectError: fmt.Errorf("ControlledValues shouldn't be specified if container scaling mode is off."),
185+
},
167186
{
168187
name: "all valid",
169188
vpa: vpa_types.VerticalPodAutoscaler{

0 commit comments

Comments
 (0)