Skip to content

Commit fad717d

Browse files
authored
Support both --userns error messages
Remove --pid when using --userns
1 parent 869b3ca commit fad717d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cwltool/singularity.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _singularity_supports_userns() -> bool:
4747
stdout=DEVNULL,
4848
universal_newlines=True,
4949
).communicate(timeout=60)[1]
50-
_USERNS = "No valid /bin/sh" in result
50+
_USERNS = "No valid /bin/sh" in result or "/bin/sh doesn't exist in container" in result
5151
except TimeoutExpired:
5252
_USERNS = False
5353
return _USERNS
@@ -388,11 +388,12 @@ def create_runtime(
388388
"--quiet",
389389
"exec",
390390
"--contain",
391-
"--pid",
392391
"--ipc",
393392
]
394393
if _singularity_supports_userns():
395394
runtime.append("--userns")
395+
else:
396+
runtime.append("--pid")
396397
if is_version_3_1_or_newer():
397398
runtime.append("--home")
398399
runtime.append(

0 commit comments

Comments
 (0)