Skip to content

Commit 2403639

Browse files
author
Klaus Ma
authored
Merge pull request #37 from volcano-sh/bug/fix_slice_error
Fix slice out of range error
2 parents d3f3479 + a26899e commit 2403639

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

test/e2e/job_scheduling.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ var _ = Describe("Job E2E Test", func() {
260260
namespace: "test",
261261
tasks: []taskSpec{
262262
{
263-
img: "nginx",
263+
img: defaultNginxImage,
264264
req: slot,
265265
min: rep,
266266
rep: rep,

test/e2e/util.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,12 +533,16 @@ func waitJobUnschedulable(ctx *context, job *vkv1.Job) error {
533533
func createContainers(img, command string, req v1.ResourceList, hostport int32) []v1.Container {
534534
container := v1.Container{
535535
Image: img,
536-
Name: img[:strings.Index(img, ":")],
537536
ImagePullPolicy: v1.PullIfNotPresent,
538537
Resources: v1.ResourceRequirements{
539538
Requests: req,
540539
},
541540
}
541+
if strings.Index(img, ":") < 0 {
542+
container.Name = img
543+
} else {
544+
container.Name = img[:strings.Index(img, ":")]
545+
}
542546

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

0 commit comments

Comments
 (0)