Skip to content

Commit e8e8fab

Browse files
committed
statd: yanger: stop overwriting infix-containers 'command' leaf
The 'command' leaf is config, with a strict pattern that doesn't allow '&', quotes or pipes. Yanger was populating it from podman's full, untruncated container command -- so any container whose entrypoint uses shell metacharacters (e.g. sh -c "... && ...") failed YANG validation. The symptom: every operational read of /infix-containers:containers returns SR_ERR_INTERNAL, which in turn fails the whole get-data on the operational datastore. This breaks case/misc/operational_all and any RESTCONF/NETCONF read that touches containers. This was introduced in 59028c4 ("Fix #1466: 'show container' shows no output"), which added the operational, pattern-less 'cmdline' leaf but left the old 'command' assignment in place. Drop it -- 'cmdline' already carries the full command line, and 'command' belongs to running config. Note: the failure can look intermittent across test runs because podman storage is persistent. It only triggers once a container with a bad-pattern command ends up in 'podman ps -a', including stale or exited leftovers from earlier runs. Signed-off-by: Richard Alpe <richard@bit42.se>
1 parent 2885112 commit e8e8fab

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

src/statd/python/yanger/infix_containers.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,6 @@ def container(ps):
234234
if path:
235235
out["cmdline"] = " ".join([path] + args)
236236

237-
cmd = inspect.get("Config", {}).get("Cmd", [])
238-
if cmd:
239-
out["command"] = " ".join(cmd)
240-
241237
net = network(ps, inspect)
242238
if net:
243239
out["network"] = net

0 commit comments

Comments
 (0)