Skip to content

Commit 9b67072

Browse files
authored
bugfix: use env datacenter (#52)
Signed-off-by: Jorge Aguilera <[email protected]>
1 parent 294818d commit 9b67072

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

plugins/nf-nomad/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ test {
9797
useJUnitPlatform()
9898
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
9999
environment 'NOMAD_ADDR', 'http://test-nf-nomad'
100+
environment 'NOMAD_DC', 'dc-test'
100101
}
101102

102103
jar {

plugins/nf-nomad/src/main/nextflow/nomad/config/NomadJobOpts.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ class NomadJobOpts{
5353
nomadJobOpts.datacenters : nomadJobOpts.datacenters.toString().split(","))
5454
as List<String>).findAll{it.size()}.unique()
5555
}else{
56-
datacenters = (sysEnv.get('NOMAD_DC')?:"").split(",") as List<String>
56+
if( sysEnv.containsKey('NOMAD_DC')) {
57+
datacenters = sysEnv.get('NOMAD_DC').split(",") as List<String>
58+
}
5759
}
5860

5961
region = nomadJobOpts.region ?: sysEnv.get('NOMAD_REGION')

plugins/nf-nomad/src/test/nextflow/nomad/NomadConfigSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class NomadConfigSpec extends Specification {
9090
])
9191

9292
expect:
93-
config.jobOpts.datacenters
93+
config.jobOpts.datacenters == List.of('dc-test')
9494
}
9595

9696
void "should use datacenters #dc with size #size if provided"() {

0 commit comments

Comments
 (0)