Skip to content

Commit e75d2bb

Browse files
committed
revert unit test
Signed-off-by: Omer Aplatony <[email protected]>
1 parent 77e0377 commit e75d2bb

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
@@ -38,6 +38,8 @@ func TestValidateVPA(t *testing.T) {
3838
badScalingMode := vpa_types.ContainerScalingMode("bad")
3939
badCPUResource := resource.MustParse("187500u")
4040
validScalingMode := vpa_types.ContainerScalingModeAuto
41+
scalingModeOff := vpa_types.ContainerScalingModeOff
42+
controlledValuesRequestsAndLimits := vpa_types.ContainerControlledValuesRequestsAndLimits
4143
tests := []struct {
4244
name string
4345
vpa vpa_types.VerticalPodAutoscaler
@@ -165,6 +167,23 @@ func TestValidateVPA(t *testing.T) {
165167
},
166168
expectError: fmt.Errorf("MaxAllowed: Memory [%v] must be a whole number of bytes", resource.MustParse("500m")),
167169
},
170+
{
171+
name: "scaling off with controlled values requests and limits",
172+
vpa: vpa_types.VerticalPodAutoscaler{
173+
Spec: vpa_types.VerticalPodAutoscalerSpec{
174+
ResourcePolicy: &vpa_types.PodResourcePolicy{
175+
ContainerPolicies: []vpa_types.ContainerResourcePolicy{
176+
{
177+
ContainerName: "loot box",
178+
Mode: &scalingModeOff,
179+
ControlledValues: &controlledValuesRequestsAndLimits,
180+
},
181+
},
182+
},
183+
},
184+
},
185+
expectError: fmt.Errorf("ControlledValues shouldn't be specified if container scaling mode is off."),
186+
},
168187
{
169188
name: "all valid",
170189
vpa: vpa_types.VerticalPodAutoscaler{

0 commit comments

Comments
 (0)