Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix in container args handling #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions podman_hpc/podman_hpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,9 @@ def _shared_run(conf, run_args, **site_opts):
container_name = f"uid-{os.getuid()}-pid-{os.getppid()}"
sock_name = f"/tmp/uid-{os.getuid()}-pid-{os.getppid()}"

# construct run and exec commands from user options
# We need to filter out any run args in the run_args
cmd = [conf.podman_bin, "run", "--help"]
valid_params = cpt.filterValidOptions(list(run_args), cmd)
# Find the first occurence not in the valid list
idx = 0
for idx, item in enumerate(run_args):
if item in valid_params:
continue
break
image = run_args[idx]
container_cmd = run_args[idx+1:]
# no filtering for container args as it can interfere with podman options
image = run_args[0]
container_cmd = run_args[1:]
# TODO: maybe do some validation on the iamge and container_cmd

options = sys.argv[
Expand Down