Skip to content

Commit

Permalink
bugfix: use env datacenter
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Aguilera <[email protected]>
  • Loading branch information
jagedn committed Jul 2, 2024
1 parent 294818d commit 340447b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions plugins/nf-nomad/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ test {
useJUnitPlatform()
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
environment 'NOMAD_ADDR', 'http://test-nf-nomad'
environment 'NOMAD_DC', 'dc-test'
}

jar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ class NomadJobOpts{
nomadJobOpts.datacenters : nomadJobOpts.datacenters.toString().split(","))
as List<String>).findAll{it.size()}.unique()
}else{
datacenters = (sysEnv.get('NOMAD_DC')?:"").split(",") as List<String>
if( sysEnv.containsKey('NOMAD_DC')) {
datacenters = sysEnv.get('NOMAD_DC').split(",") as List<String>
}
}

region = nomadJobOpts.region ?: sysEnv.get('NOMAD_REGION')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class NomadConfigSpec extends Specification {
])

expect:
config.jobOpts.datacenters
config.jobOpts.datacenters == List.of('dc-test')
}

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

0 comments on commit 340447b

Please sign in to comment.