Skip to content

Commit

Permalink
Merge pull request #37 from volcano-sh/bug/fix_slice_error
Browse files Browse the repository at this point in the history
Fix slice out of range error
  • Loading branch information
Klaus Ma authored Mar 22, 2019
2 parents d3f3479 + a26899e commit 2403639
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/e2e/job_scheduling.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ var _ = Describe("Job E2E Test", func() {
namespace: "test",
tasks: []taskSpec{
{
img: "nginx",
img: defaultNginxImage,
req: slot,
min: rep,
rep: rep,
Expand Down
6 changes: 5 additions & 1 deletion test/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,16 @@ func waitJobUnschedulable(ctx *context, job *vkv1.Job) error {
func createContainers(img, command string, req v1.ResourceList, hostport int32) []v1.Container {
container := v1.Container{
Image: img,
Name: img[:strings.Index(img, ":")],
ImagePullPolicy: v1.PullIfNotPresent,
Resources: v1.ResourceRequirements{
Requests: req,
},
}
if strings.Index(img, ":") < 0 {
container.Name = img
} else {
container.Name = img[:strings.Index(img, ":")]
}

if len(command) > 0 {
container.Command = []string{"/bin/sh"}
Expand Down

0 comments on commit 2403639

Please sign in to comment.