Skip to content

Commit

Permalink
Fix non-deterministic null container engine error
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed May 29, 2023
1 parent 166b363 commit f227f2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions modules/nextflow/src/main/groovy/nextflow/Session.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1204,12 +1204,13 @@ class Session implements ISession {
}

private void getContainerConfig0(String engine, List<Map> drivers) {
def config = this.config?.get(engine)
if( config instanceof Map ) {
config.engine = engine
drivers << config
final entry = this.config?.get(engine)
if( entry instanceof Map ) {
final config0 = new LinkedHashMap((Map)entry)
config0.put('engine', engine)
drivers.add(config0)
}
else if( config!=null ) {
else if( entry!=null ) {
log.warn "Malformed configuration for container engine '$engine' -- One or more attributes should be provided"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class SessionTest extends Specification {
def session = new Session([(ENGINE): CONFIG])

expect:
session.containerConfig == CONFIG as ContainerConfig
session.containerConfig == new ContainerConfig(CONFIG + [engine:ENGINE])
session.containerConfig.enabled
session.containerConfig.engine == ENGINE

Expand Down

0 comments on commit f227f2e

Please sign in to comment.