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
expectedErr: "spec.resourcePolicy.containerPolicies[0].oomBumpUpRatio: Invalid value: -1: spec.resourcePolicy.containerPolicies[0].oomBumpUpRatio in body should be greater than or equal to 1",
914
+
expectedErr: "admission webhook .*vpa.* denied the request:",
f.It("accepts valid and rejects invalid VPA object with features.PerVPAConfig enabled", framework.WithFeatureGate(features.PerVPAConfig), func() {
926
+
ginkgo.By("Setting up invalid VPA objects")
927
+
testCases:= []struct {
928
+
namestring
929
+
vpaJSONstring
930
+
expectedErrstring
931
+
}{
906
932
{
907
-
name: "Invalid oomBumpUpRatio (string value)",
933
+
name: "Invalid oomBumpUpRatio (negative value)",
908
934
vpaJSON: `{
909
935
"apiVersion": "autoscaling.k8s.io/v1",
910
936
"kind": "VerticalPodAutoscaler",
@@ -921,16 +947,16 @@ var _ = AdmissionControllerE2eDescribe("Admission-controller", ginkgo.Label("FG:
921
947
"resourcePolicy": {
922
948
"containerPolicies": [{
923
949
"containerName": "*",
924
-
"oomBumpUpRatio": "12",
950
+
"oomBumpUpRatio": -1,
925
951
"oomMinBumpUp": 104857600
926
952
}]
927
953
}
928
954
}
929
955
}`,
930
-
expectedErr: "json: cannot unmarshal string into Go struct field ContainerResourcePolicy.spec.resourcePolicy.containerPolicies.oomBumpUpRatio of type float64",
956
+
expectedErr: "admission webhook \"vpa.k8s.io\" denied the request: oomBumpUpRatio must be greater than or equal to 1.0, got -1",
931
957
},
932
958
{
933
-
name: "Invalid oomBumpUpRatio (less than 1)",
959
+
name: "Invalid oomBumpUpRatio (string value)",
934
960
vpaJSON: `{
935
961
"apiVersion": "autoscaling.k8s.io/v1",
936
962
"kind": "VerticalPodAutoscaler",
@@ -947,16 +973,16 @@ var _ = AdmissionControllerE2eDescribe("Admission-controller", ginkgo.Label("FG:
947
973
"resourcePolicy": {
948
974
"containerPolicies": [{
949
975
"containerName": "*",
950
-
"oomBumpUpRatio": 0.5,
976
+
"oomBumpUpRatio": "not-a-number",
951
977
"oomMinBumpUp": 104857600
952
978
}]
953
979
}
954
980
}
955
981
}`,
956
-
expectedErr: "spec.resourcePolicy.containerPolicies[0].oomBumpUpRatio: Invalid value: 0.5: spec.resourcePolicy.containerPolicies[0].oomBumpUpRatio in body should be greater than or equal to 1",
982
+
expectedErr: "admission webhook \"vpa\\.k8s\\.io\" denied the request: quantities must match the regular expression",
957
983
},
958
984
{
959
-
name: "Invalid oomMinBumpUp (negative value)",
985
+
name: "Invalid oomBumpUpRatio (less than 1)",
960
986
vpaJSON: `{
961
987
"apiVersion": "autoscaling.k8s.io/v1",
962
988
"kind": "VerticalPodAutoscaler",
@@ -973,45 +999,45 @@ var _ = AdmissionControllerE2eDescribe("Admission-controller", ginkgo.Label("FG:
973
999
"resourcePolicy": {
974
1000
"containerPolicies": [{
975
1001
"containerName": "*",
976
-
"oomBumpUpRatio": 2,
977
-
"oomMinBumpUp": -1
1002
+
"oomBumpUpRatio": 0.5,
1003
+
"oomMinBumpUp": 104857600
978
1004
}]
979
1005
}
980
1006
}
981
1007
}`,
982
-
expectedErr: "spec.resourcePolicy.containerPolicies[0].oomMinBumpUp: Invalid value: -1: spec.resourcePolicy.containerPolicies[0].oomMinBumpUp in body should be greater than or equal to 0",
1008
+
expectedErr: "admission webhook \"vpa.k8s.io\" denied the request: oomBumpUpRatio must be greater than or equal to 1.0, got 0.5",
0 commit comments