Repository navigation
Pass the egress CA env to commands run through a routed container - #343
github-actions[bot] wants to merge 1 commit into
Conversation
The env passed to container.start() reaches only the entrypoint, so Node tools run by exec() never saw NODE_EXTRA_CA_CERTS and rejected the intercepting CA. Merge CA_ENV into each routed exec()'s env. Gardener-Operation: op_5dc8a0b12a309e3d3f49fa8cd5704de7abbdddf7d9c2ecff406d012bae92d151:0c5bc306f52febe258af34684ab953c0529eb220b5c82475c3b695329ca2e3e4
🦋 Changeset detectedLatest commit: cf4b23a The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| it("gives each command routed through an egress the CA's env, over its own", async () => { | ||
| const { container, execOptions } = interceptingContainer(); | ||
| const target = egressing(container); | ||
| await target.exec(["a"], { env: { A: "1", SSL_CERT_FILE: "/mine" } }, EGRESS); | ||
| await target.exec(["b"], undefined, EGRESS); | ||
| expect(execOptions).toEqual([ | ||
| { env: { A: "1", ...CA_ENV }, user: "0:0" }, | ||
| { env: CA_ENV, user: "0:0" }, | ||
| ]); |
There was a problem hiding this comment.
🔍 Routed Node HTTPS lacks end-to-end coverage
The stub checks exec options but never launches Node. The remote-exec agent rebuilds the child environment from its own environment and the image’s. A routed Node HTTPS smoke test would verify the fix at the user-facing boundary.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Declined for this PR. This is a coverage suggestion, not a defect. environment() in packages/remote-exec/src/procs.rs applies the command's own env last (env.extend(given…)), after the agent's and the image's env, so the CA_ENV that exec() now passes reaches the child. The repo has no harness that runs a real routed container with Node, and none of the vitest configs under packages/computer start one. Building that harness is separate work. The new sandbox.test.ts cases check the contract at the ContainerExec boundary, which is where this change sits.
|
This round I reviewed one thread and changed no code.
The review body only gave a count of findings and had no other feedback. Tests: none ran this round. The runner's command tool failed when I tried vitest, so CI or a maintainer still needs to run the |
Fixes #342
Cause
ContainerExec.#start()addsCA_ENVto the env given tocontainer.start()(packages/computer/src/remote-exec/sandbox.ts:374). That env reaches only the entrypoint.ContainerExec.exec()(sandbox.ts:~447) passed the caller's options to the platformexec()unchanged, so commands never hadNODE_EXTRA_CA_CERTS, and Node tools rejected the intercepting CA.Change
When the container is routed through an egress,
exec()now setsenvto the caller's env plusCA_ENV, withCA_ENVtaking precedence, as it does at start. Commands without an egress are untouched. No new API. I added a changeset and two tests insandbox.test.ts: routed commands get the env, unrouted ones keep theirs.Alternatives
exec()commands and adds state to maintain.CA_ENV: this would change behaviour for containers that aren't routed.Checks
I ran prettier on the changed files. I could not run vitest or tsc: dependencies could not be installed on the runner. The new tests have not been run, so CI or a maintainer needs to run them.
Commits pushed by this task don't start CI. A maintainer can mention @ask-gardener on this pull request to switch to an alternative or ask for changes.