Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Remove resource injection on the node for container task
Browse files Browse the repository at this point in the history
Signed-off-by: byhsu <[email protected]>
  • Loading branch information
ByronHsu committed Mar 29, 2023
1 parent b1e5482 commit e377136
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
2 changes: 0 additions & 2 deletions pkg/compiler/transformers/k8s/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ func buildNodeSpec(n *core.Node, tasks []*core.CompiledTask, errs errors.Compile

if n.GetTaskNode().Overrides != nil && n.GetTaskNode().Overrides.Resources != nil {
resources = n.GetTaskNode().Overrides.Resources
} else {
resources = getResources(task)
}
}

Expand Down
16 changes: 0 additions & 16 deletions pkg/compiler/transformers/k8s/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,6 @@ func TestBuildNodeSpec(t *testing.T) {
mustBuild(t, n, 1, errs.NewScope())
})

t.Run("Task with resources", func(t *testing.T) {
expectedCPU := resource.MustParse("10Mi")
n.Node.Target = &core.Node_TaskNode{
TaskNode: &core.TaskNode{
Reference: &core.TaskNode_ReferenceId{
ReferenceId: &core.Identifier{Name: "ref_2"},
},
},
}

spec := mustBuild(t, n, 1, errs.NewScope())
assert.NotNil(t, spec.Resources)
assert.NotNil(t, spec.Resources.Requests.Cpu())
assert.Equal(t, expectedCPU.Value(), spec.Resources.Requests.Cpu().Value())
})

t.Run("node with resource overrides", func(t *testing.T) {
expectedCPU := resource.MustParse("20Mi")
n.Node.Target = &core.Node_TaskNode{
Expand Down

0 comments on commit e377136

Please sign in to comment.