Skip to content

Commit

Permalink
Trim extra characters in image.
Browse files Browse the repository at this point in the history
Trim the space, tab, single quote and double quotes in the image field.
  • Loading branch information
jealous committed Oct 7, 2023
1 parent a1507e3 commit 8a09ad8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ class FloatGridExecutor extends AbstractGridExecutor {

validate(task)

final container = task.getContainer()
final container = task.getContainer().strip(" \t\'\"")
if (!container) {
throw new AbortOperationException("container is empty. " +
"you can specify a default container image " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,23 @@ class FloatGridExecutorTest extends FloatBaseTest {
cmd.join(' ') == submitCmd().join(' ')
}

def "trim space and quotes in image"() {
given:
final exec = newTestExecutor()
final task = newTask(exec, new TaskConfig(
cpus: cpu,
memory: "$mem G",
container: "\"' $image\t'\"",
))

when:
final cmd = exec.getSubmitCommandLine(task, Paths.get(script))
final expected = submitCmd()

then:
cmd.join(' ') == expected.join(' ')
}

def "parse data volume"() {
given:
final exec = newTestExecutor()
Expand Down

0 comments on commit 8a09ad8

Please sign in to comment.