Skip to content

Commit 640c1b3

Browse files
committed
removed prev unit tests
Signed-off-by: Omer Aplatony <[email protected]>
1 parent d1d4fb5 commit 640c1b3

File tree

1 file changed

+0
-164
lines changed

1 file changed

+0
-164
lines changed

vertical-pod-autoscaler/e2e/v1/admission_controller.go

Lines changed: 0 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -877,170 +877,6 @@ var _ = AdmissionControllerE2eDescribe("Admission-controller", ginkgo.Label("FG:
877877
vpaJSON string
878878
expectedErr string
879879
}{
880-
{
881-
name: "Invalid oomBumpUpRatio (negative value)",
882-
vpaJSON: `{
883-
"apiVersion": "autoscaling.k8s.io/v1",
884-
"kind": "VerticalPodAutoscaler",
885-
"metadata": {"name": "oom-test-vpa"},
886-
"spec": {
887-
"targetRef": {
888-
"apiVersion": "apps/v1",
889-
"kind": "Deployment",
890-
"name": "oom-test"
891-
},
892-
"updatePolicy": {
893-
"updateMode": "Auto"
894-
},
895-
"resourcePolicy": {
896-
"containerPolicies": [{
897-
"containerName": "*",
898-
"oomBumpUpRatio": -1,
899-
"oomMinBumpUp": 104857600
900-
}]
901-
}
902-
}
903-
}`,
904-
expectedErr: "admission webhook \"vpa.k8s.io\" denied the request: oomBumpUpRatio must be greater than or equal to 1.0, got -1",
905-
},
906-
{
907-
name: "Invalid oomBumpUpRatio (string value)",
908-
vpaJSON: `{
909-
"apiVersion": "autoscaling.k8s.io/v1",
910-
"kind": "VerticalPodAutoscaler",
911-
"metadata": {"name": "oom-test-vpa"},
912-
"spec": {
913-
"targetRef": {
914-
"apiVersion": "apps/v1",
915-
"kind": "Deployment",
916-
"name": "oom-test"
917-
},
918-
"updatePolicy": {
919-
"updateMode": "Auto"
920-
},
921-
"resourcePolicy": {
922-
"containerPolicies": [{
923-
"containerName": "*",
924-
"oomBumpUpRatio": "12",
925-
"oomMinBumpUp": 104857600
926-
}]
927-
}
928-
}
929-
}`,
930-
expectedErr: "json: cannot unmarshal string into Go struct field ContainerResourcePolicy.spec.resourcePolicy.containerPolicies.oomBumpUpRatio of type float64",
931-
},
932-
{
933-
name: "Invalid oomBumpUpRatio (less than 1)",
934-
vpaJSON: `{
935-
"apiVersion": "autoscaling.k8s.io/v1",
936-
"kind": "VerticalPodAutoscaler",
937-
"metadata": {"name": "oom-test-vpa"},
938-
"spec": {
939-
"targetRef": {
940-
"apiVersion": "apps/v1",
941-
"kind": "Deployment",
942-
"name": "oom-test"
943-
},
944-
"updatePolicy": {
945-
"updateMode": "Auto"
946-
},
947-
"resourcePolicy": {
948-
"containerPolicies": [{
949-
"containerName": "*",
950-
"oomBumpUpRatio": 0.5,
951-
"oomMinBumpUp": 104857600
952-
}]
953-
}
954-
}
955-
}`,
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",
957-
},
958-
{
959-
name: "Invalid oomMinBumpUp (negative value)",
960-
vpaJSON: `{
961-
"apiVersion": "autoscaling.k8s.io/v1",
962-
"kind": "VerticalPodAutoscaler",
963-
"metadata": {"name": "oom-test-vpa"},
964-
"spec": {
965-
"targetRef": {
966-
"apiVersion": "apps/v1",
967-
"kind": "Deployment",
968-
"name": "oom-test"
969-
},
970-
"updatePolicy": {
971-
"updateMode": "Auto"
972-
},
973-
"resourcePolicy": {
974-
"containerPolicies": [{
975-
"containerName": "*",
976-
"oomBumpUpRatio": 2,
977-
"oomMinBumpUp": -1
978-
}]
979-
}
980-
}
981-
}`,
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",
983-
},
984-
{
985-
name: "Invalid evictAfterOOMThreshold (negative duration)",
986-
vpaJSON: `{
987-
"apiVersion": "autoscaling.k8s.io/v1",
988-
"kind": "VerticalPodAutoscaler",
989-
"metadata": {"name": "evict-threshold-vpa"},
990-
"spec": {
991-
"targetRef": {
992-
"apiVersion": "apps/v1",
993-
"kind": "Deployment",
994-
"name": "hamster"
995-
},
996-
"updatePolicy": {
997-
"updateMode": "Auto",
998-
"evictAfterOOMThreshold": "-5m"
999-
}
1000-
}
1001-
}`,
1002-
expectedErr: "spec.updatePolicy.evictAfterOOMThreshold: Invalid value:.*evictAfterOOMThreshold must be greater equal to 0",
1003-
},
1004-
{
1005-
name: "Invalid evictAfterOOMThreshold (invalid format)",
1006-
vpaJSON: `{
1007-
"apiVersion": "autoscaling.k8s.io/v1",
1008-
"kind": "VerticalPodAutoscaler",
1009-
"metadata": {"name": "evict-threshold-vpa"},
1010-
"spec": {
1011-
"targetRef": {
1012-
"apiVersion": "apps/v1",
1013-
"kind": "Deployment",
1014-
"name": "hamster"
1015-
},
1016-
"updatePolicy": {
1017-
"updateMode": "Auto",
1018-
"evictAfterOOMThreshold": "not-a-duration"
1019-
}
1020-
}
1021-
}`,
1022-
expectedErr: "spec.updatePolicy.evictAfterOOMThreshold.*invalid duration",
1023-
},
1024-
{
1025-
name: "Invalid evictAfterOOMThreshold (invalid unit)",
1026-
vpaJSON: `{
1027-
"apiVersion": "autoscaling.k8s.io/v1",
1028-
"kind": "VerticalPodAutoscaler",
1029-
"metadata": {"name": "evict-threshold-vpa"},
1030-
"spec": {
1031-
"targetRef": {
1032-
"apiVersion": "apps/v1",
1033-
"kind": "Deployment",
1034-
"name": "hamster"
1035-
},
1036-
"updatePolicy": {
1037-
"updateMode": "Auto",
1038-
"evictAfterOOMThreshold": "5x"
1039-
}
1040-
}
1041-
}`,
1042-
expectedErr: "spec.updatePolicy.evictAfterOOMThreshold.*Pattern",
1043-
},
1044880
{
1045881
name: "Invalid minAllowed (invalid requests field)",
1046882
vpaJSON: `{

0 commit comments

Comments
 (0)