diff --git a/pkg/cmd/run/view/fixtures/run_log.zip b/pkg/cmd/run/view/fixtures/run_log.zip index 2422c3b2496..757a6398307 100644 Binary files a/pkg/cmd/run/view/fixtures/run_log.zip and b/pkg/cmd/run/view/fixtures/run_log.zip differ diff --git a/pkg/cmd/run/view/view.go b/pkg/cmd/run/view/view.go index 73ef7bb1ed7..c794cff9af2 100644 --- a/pkg/cmd/run/view/view.go +++ b/pkg/cmd/run/view/view.go @@ -546,6 +546,7 @@ func logFilenameRegexp(job shared.Job, step shared.Step) *regexp.Regexp { // * Truncate long job names // sanitizedJobName := strings.ReplaceAll(job.Name, "/", "") + sanitizedJobName = strings.ReplaceAll(sanitizedJobName, ":", "") sanitizedJobName = truncateAsUTF16(sanitizedJobName, JOB_NAME_MAX_LENGTH) re := fmt.Sprintf(`^%s\/%d_.*\.txt`, regexp.QuoteMeta(sanitizedJobName), step.Number) return regexp.MustCompile(re) diff --git a/pkg/cmd/run/view/view_test.go b/pkg/cmd/run/view/view_test.go index 44ca69fa689..956f80cd5dc 100644 --- a/pkg/cmd/run/view/view_test.go +++ b/pkg/cmd/run/view/view_test.go @@ -1522,6 +1522,18 @@ func Test_attachRunLog(t *testing.T) { // not the double space in the dir name, as the slash has been removed wantFilename: "cool job with slash/1_fob the barz.txt", }, + { + name: "job name with colon matches dir with colon removed", + job: shared.Job{ + Name: "cool job : with colon", + Steps: []shared.Step{{ + Name: "fob the barz", + Number: 1, + }}, + }, + wantMatch: true, + wantFilename: "cool job with colon/1_fob the barz.txt", + }, { name: "Job name with really long name (over the ZIP limit)", job: shared.Job{