Skip to content

e2e: the container limits an operator wrote are the ones docker is given - #265

Merged
dinstein merged 1 commit into
mainfrom
container-args
Aug 8, 2026
Merged

e2e: the container limits an operator wrote are the ones docker is given#265
dinstein merged 1 commit into
mainfrom
container-args

Conversation

@dinstein

@dinstein dinstein commented Aug 8, 2026

Copy link
Copy Markdown
Owner

The container flags — --memory, --cpus, --network, --container-user,
--container-workdir, --docker-arg — had no end-to-end coverage at all. The
one docker case in the suite proves a container runs, and skips itself
wherever no Docker daemon does; nothing checked that the limits an operator
wrote are the limits the container gets.

They fail in the direction that does not announce itself. A dropped
--memory is a container with no cap, which behaves exactly like one with a
cap until the day it does not; a dropped --network none is a downstream with
the network it was specifically denied.

These need no Docker. transport.DockerBinary searches PATH before its
well-known locations, so a recording stand-in placed earlier on PATH is what
the gateway executes — and what it records is the real command line the
spawner built, not a second rendering written for a test.

  • 1. The limits, the secret that must not reach the argv, and where --docker-arg lands

… is given

The container flags had no coverage. The suite's one docker case proves a
container runs and skips itself without a daemon, so nothing checked that
--memory, --cpus, --network, --container-user or --container-workdir survive
the trip to the command line. They fail quietly: a dropped memory cap behaves
like a cap until the day it does not, and a dropped `--network none` is a
downstream with the network it was denied.

The fixture needs no Docker. DockerBinary searches PATH before its well-known
locations, so a recording stand-in earlier on PATH is what runs — and it
records the real argv the spawner built rather than a second rendering of the
same config. Assertions are flag/value pairs, not substrings: "--memory"
appearing somewhere says nothing about what it was set to.

The second case is the security half. A container's command line is readable
in ps(1), so passing -e KEY=value would put every configured API key there
for any process on the machine, including the ones a contained downstream
exists to be protected from. The spawner passes -e KEY alone and routes the
value through the CLI's own environment, so the assertion is that the VALUE is
absent everywhere in the argv — the flag being present only establishes the
variable was not dropped.

The third pins where --docker-arg lands, which is the whole of its contract:
before the image it configures the container, after it configures the
contained program.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dinstein
dinstein merged commit ce148d7 into main Aug 8, 2026
3 checks passed
@dinstein
dinstein deleted the container-args branch August 8, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant