Skip to content

Commit

Permalink
fix(workspace-manager): do not generate job names with trailing hyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
odzhychko committed Dec 17, 2024
1 parent fafacea commit a6096f8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ class WorkspaceJobQueue(val tokenGenerator: (Workspace) -> String) {
var jobName = JOB_PREFIX + cleanName
val charsToRemove = jobName.length - (63 - 16)
if (charsToRemove > 0) jobName = jobName.substring(0, jobName.length - charsToRemove)
return jobName
// Delete forbidden trailing hyphens ("-") that could be part of `HashUtil.sha256`.
// HashUtil.sha256 uses Base64 for URL which might contain "-".
return jobName.trimEnd('-')
}
}
}

0 comments on commit a6096f8

Please sign in to comment.