-
Notifications
You must be signed in to change notification settings - Fork 386
Open
Description
I'm trying to use a createRuntime hook, but it's not getting the "bundle" path in input.
Normally the input contains something like
"bundle": "/var/lib/containers/storage/overlay-containers/51c44da9ee097e65d48c03208346ec1b396c4c58b99aa50f513dbd3a6d835927/userdata",
but in my setup I'm just getting this:
{
"ociVersion": "1.0",
"id": "1975b4da6dcf504d3d3507502ff9a780d45a2dd10246e609f8c2cc6ca918541c",
"pid": 65910,
"root": "/var/tmp/intermediate-mountpoint-0.0",
"bundle": "/",
"status": "created",
"annotations": {
"io.container.manager": "libpod",
"io.podman.annotations.userns": "private",
"org.opencontainers.image.stopSignal": "15",
"org.systemd.property.KillSignal": "15",
"org.systemd.property.TimeoutStopUSec": "uint64 10000000"
}
}
To trigger the problem I have found there must be a "deviceNodes" setup, and in addition use of uid mappings.
The commands I'm using are
sudo podman create --name test-pod --uidmap 0:100000:65536 --device mytest/hook=run almalinux:9
sudo podman start test-pod
A minimal /etc/cdi/mytest.yaml looks like this:
---
cdiVersion: 0.5.0
kind: mytest/hook
devices:
- name: run
containerEdits:
hooks:
- hookName: createRuntime
path: /tmp/my-hook.sh
args:
- my-hook.sh
- createRuntime 1
containerEdits:
deviceNodes:
- path: /dev/tty12
and the script /tmp/my-hook.sh just contains some simple logging to be able to observe the state input:
#!/bin/sh
input=$(cat)
(
echo "==="
echo "Running $0 with args: $*"
echo "Current diretory: $(pwd)"
echo "Input was: $input"
echo ">>> formatted >>>"
echo "$input" | jq .
echo "<<< formatted <<<"
echo "==="
echo ""
) > /tmp/hooks.log 2>&1
This should hopefully make it simple to reproduce.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels