Repository navigation
Conversation
128108f to
8ca0bb2
Compare
8ca0bb2 to
f8f82f4
Compare
f8f82f4 to
e461c11
Compare
e461c11 to
a7a0fa1
Compare
a7a0fa1 to
2522dcc
Compare
2522dcc to
0e4cee4
Compare
evanphx
left a comment
There was a problem hiding this comment.
Makes sense! Better than the pattern matching.
A secret has reached a container as an env entry whose value starts with miren+secret://, and the runner resolves anything matching that prefix. So whether a value is a secret is decided by pattern-matching a string that many sources write, and every producer has to be stopped from writing a literal that looks like a reference. The container spec now has a secret field, separate from env, naming each secret's backend and reference and the variable it projects into. appspec.Build fills it for every backend-sourced variable and sets secrets_typed. A runner that sees the marker resolves only the typed field and treats env as literal, so a value that merely looks like a sentinel is handed to the app verbatim. This release still writes the sentinel too, so a runner from before the typed field keeps working; it ignores the new attrs. Dropping the sentinel waits for a release that requires runners from this one or newer, and the rejection of literals posing as references at pin time stays until then, since specs built before this change still rely on it. specsMatch compares the typed secrets, so a rotation still rolls a pool. For a pool created before the upgrade it reads the sentinels in env back as the secrets they name. The launcher rebuilds every app's spec each minute, so without that, every app with a secret would replace its sandboxes (and drain any disk service first) right after the coordinator upgrade. Instead an old pool keeps running until the app changes for some other reason. The marker alone is not compared, for the same reason: with equal secrets the runner materializes the same environment either way. Part of MIR-2250.
0e4cee4 to
6c6785e
Compare
There was a problem hiding this comment.
🍪 biscuit: ✅ ready to merge — auto-review, non-blocking
Approval recommended, not submitted: this repository is not enabled for autonomous approvals. This review is a comment, not a GitHub approval.
Since 0e4cee4, the only change in this layer is that it no longer touches pkg/nodecaps/nodecaps.go. At 0e4cee4 this PR added a SecretTyped capability there. #1458's new head removes the nodecaps package entirely, so the file doesn't exist at 6c6785e and the capability is gone with it. Nothing in this PR ever read that capability. The transition depends on dual-writing: appspec.Build still writes every backend-sourced variable twice, once as a typed entry and once as a sentinel. The ticket accepts either a dual-write release or a capability check, so losing the capability doesn't leave a gap here. The one consequence is for the later release that stops writing sentinels. It won't be able to ask the cluster whether every runner understands the typed field, so it has to rely on a minimum runner version. The PR description already says that's the plan.
The rest of the layer is what I reviewed last time:
- the covered-key and legacy branches in
materialize.go - the
ExtraEnvtrimming inBuild effectiveSecrets/secretsEqualinspecsMatchcontainerEnvin the sandbox controller
buildSubContainerSpec is still the only non-test caller in controllers/ that materializes env, and it calls MaterializeContainerEnv. Nobody has posted a new comment or reply, and both of my threads are still resolved.
I'd held back from recommending approval for two reasons, and both are now settled. I wanted a human to read the transition logic, and evanphx approved at 0e4cee4, where that logic is identical to this head. #1458 is also no longer a draft. The only change since that approval removes an unused constant, so I'm recommending approval of this layer. It should still merge after #1458, since it's stacked on it.
🍪 full review note · reviewed at 6c6785e
Secrets reach a container as env entries starting with
miren+secret://, and the runner resolves anything with that prefix. So "is this a secret?" comes down to pattern-matching a string that lots of things write, and every producer has to be stopped from writing a literal that happens to look like one.The sandbox spec now carries secrets in their own typed field. A runner that sees the
secrets_typedmarker resolves only that field and treats env as literal. This release still writes the sentinel too, so older runners keep working. Dropping the sentinel, and the check that rejects literals posing as references, waits for a release that requires runners from this one or newer.The upgrade itself doesn't roll anything. When the launcher compares specs, it reads an old pool's sentinels back as the secrets they name, so pools from before the upgrade keep running until the app changes for some other reason.
Stacked on #1458.
Part of MIR-2250