Skip to content

Commit

Permalink
delete qos limit in webhook;
Browse files Browse the repository at this point in the history
Signed-off-by: shaoqiu <516595344@qq.com>
  • Loading branch information
waiterQ committed Sep 28, 2022
1 parent 014ccb3 commit 3b77d11
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
9 changes: 0 additions & 9 deletions pkg/webhooks/admission/jobs/validate/admit_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"k8s.io/klog"
k8score "k8s.io/kubernetes/pkg/apis/core"
k8scorev1 "k8s.io/kubernetes/pkg/apis/core/v1"
v1qos "k8s.io/kubernetes/pkg/apis/core/v1/helper/qos"
k8scorevalid "k8s.io/kubernetes/pkg/apis/core/validation"
"k8s.io/kubernetes/pkg/capabilities"

Expand Down Expand Up @@ -367,14 +366,6 @@ func validateTaskTopoPolicy(task v1alpha1.TaskSpec, index int) string {
}
}

pod := &v1.Pod{
Spec: template.Spec,
}

if v1qos.GetPodQOS(pod) != v1.PodQOSGuaranteed {
return fmt.Sprintf("spec.task[%d] isn't Guaranteed pod, kind=%v", index, v1qos.GetPodQOS(pod))
}

for id, container := range append(template.Spec.Containers, template.Spec.InitContainers...) {
requestNum := guaranteedCPUs(container)
if requestNum == 0 {
Expand Down
26 changes: 0 additions & 26 deletions pkg/webhooks/admission/jobs/validate/admit_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1477,32 +1477,6 @@ func TestValidateTaskTopoPolicy(t *testing.T) {
},
expect: "the cpu request isn't an integer",
},
{
name: "test-3",
taskSpec: v1alpha1.TaskSpec{
Name: "task-3",
Replicas: 5,
TopologyPolicy: v1alpha1.Restricted,
Template: v1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"name": "test"},
},
Spec: v1.PodSpec{
Containers: []v1.Container{
{
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceCPU: *resource.NewQuantity(1, ""),
v1.ResourceMemory: *resource.NewQuantity(2000, resource.BinarySI),
},
},
},
},
},
},
},
expect: "isn't Guaranteed pod",
},
}

for _, testcase := range testCases {
Expand Down

0 comments on commit 3b77d11

Please sign in to comment.