Fix handling of $NAME and $IMAGE in runlabel

Fixes: https://github.com/containers/podman/issues/9405

Add system runlabel tests.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2021-04-05 18:12:50 -04:00
parent 9d3e310710
commit 8f16742187
3 changed files with 45 additions and 14 deletions

View File

@ -13,7 +13,7 @@ exist, `podman container runlabel` will just exit.
If the container image has a LABEL INSTALL instruction like the following:
`LABEL INSTALL /usr/bin/podman run -t -i --rm \${OPT1} --privileged -v /:/host --net=host --ipc=host --pid=host -e HOST=/host -e NAME=\${NAME} -e IMAGE=\${IMAGE} -e CONFDIR=\/etc/${NAME} -e LOGDIR=/var/log/\${NAME} -e DATADIR=/var/lib/\${NAME} \${IMAGE} \${OPT2} /bin/install.sh \${OPT3}`
`LABEL INSTALL /usr/bin/podman run -t -i --rm \${OPT1} --privileged -v /:/host --net=host --ipc=host --pid=host -e HOST=/host -e NAME=\${NAME} -e IMAGE=\${IMAGE} -e CONFDIR=/etc/\${NAME} -e LOGDIR=/var/log/\${NAME} -e DATADIR=/var/lib/\${NAME} \${IMAGE} \${OPT2} /bin/install.sh \${OPT3}`
`podman container runlabel` will set the following environment variables for use in the command: