Skip to content

Commit bfc6277

Browse files
committed
Add secret to the list of expected directives
1 parent 4c57cbf commit bfc6277

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/main/resources/io/viash/runners/nextflow/workflowFactory/processDirectives.nf

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def processDirectives(Map drctv) {
1515

1616
// check for unexpected keys
1717
def expectedKeys = [
18-
"accelerator", "afterScript", "beforeScript", "cache", "conda", "container", "containerOptions", "cpus", "disk", "echo", "errorStrategy", "executor", "machineType", "maxErrors", "maxForks", "maxRetries", "memory", "module", "penv", "pod", "publishDir", "queue", "label", "scratch", "storeDir", "stageInMode", "stageOutMode", "tag", "time"
18+
"accelerator", "afterScript", "beforeScript", "cache", "conda", "container", "containerOptions", "cpus", "disk", "echo", "errorStrategy", "executor", "machineType", "maxErrors", "maxForks", "maxRetries", "memory", "module", "penv", "pod", "publishDir", "queue", "label", "scratch", "secret", "storeDir", "stageInMode", "stageOutMode", "tag", "time"
1919
]
2020
def unexpectedKeys = drctv.keySet() - expectedKeys
2121
assert unexpectedKeys.isEmpty() : "Unexpected keys in process directive: '${unexpectedKeys.join("', '")}'"
@@ -345,6 +345,21 @@ def processDirectives(Map drctv) {
345345
assert drctv["scratch"] == true || drctv["scratch"] instanceof CharSequence
346346
}
347347

348+
/* DIRECTIVE secret
349+
accepted examples:
350+
- "MY_ACCESS_KEY"
351+
- ["MY_ACCESS_KEY", "MY_SECRET_KEY"]
352+
*/
353+
if (drctv.containsKey("secret")) {
354+
if (drctv["secret"] instanceof CharSequence) {
355+
drctv["secret"] = [ drctv["secret"] ]
356+
}
357+
assert drctv["secret"] instanceof List
358+
drctv["secret"].forEach { secret ->
359+
assert secret instanceof CharSequence
360+
}
361+
}
362+
348363
/* DIRECTIVE storeDir
349364
accepted examples:
350365
- "/path/to/storeDir"

0 commit comments

Comments
 (0)