Skip to content

First hook arg is overwritten with cmd #1663

Description

@nakato

Setup

oci-runtime-tool: 0.3.0
runc: 1.0.0-rc4 and fb6ec65

Problem

When attempting to run a hook command with 1 or more arguments the first arg argument is discarded and replaced with the contents of path.

Given the following:

{
    ...
    "hooks": {
        "prestart": [
            "path": "/test.py",
            "args": [
                "pre"
            ]
        ],
    ...
}

the hook recives argv of ["/test.py"]

Given:

{
    ...
    "hooks": {
        "prestart": [
            "path": "/test.py",
            "args": [
                "anything",
                "pre"
            ]
        ],
    ...
}

The hook recives an argv of ["/test.py", "pre"]

Expectation

To me, I would expect that given the first example above, that the hook's argv looks like ["/test.py", "pre"], and the second one ["/test.py", "anything", "pre"]

Using q pip install q for lazy logging, the following will dump the argv to /tmp/q, and then promptly exit.

#!/usr/bin/env python3

import sys

import q

q(len(sys.argv))
q(sys.argv)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions