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:
materialize.goExtraEnv trimming in BuildeffectiveSecrets/secretsEqual in specsMatchcontainerEnv in the sandbox controllerbuildSubContainerSpec 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.
Verdict: ready
{
"owner": "mirendev",
"repo": "runtime",
"number": 1459,
"verdict": "ready",
"approve": true,
"event": "approve",
"summary": "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.\n\nThe rest of the layer is what I reviewed last time:\n- the covered-key and legacy branches in `materialize.go`\n- the `ExtraEnv` trimming in `Build`\n- `effectiveSecrets`/`secretsEqual` in `specsMatch`\n- `containerEnv` in the sandbox controller\n\n`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.\n\nI'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.",
"posted_to_pr": true,
"head_sha": "6c6785e93700860c13561cb3a9e57180409194c7"
}The code in this layer is the same as last round. 0e4cee4 is the same single commit rebased onto #1458's new head, with the same commit message. Every file this PR touches has the same blob SHA it had at 2522dcc. Nobody has left a new comment or reply, and both of my threads are still resolved.
I traced both callers of appspec.Build, the deployment launcher and the run controller, against the rebased base. Neither passes ExtraEnv. In both, every backend-sourced variable reaches the spec as a typed entry with its matching sentinel, so a new runner's covered-key skip and an old runner's sentinel resolution give the container the same environment. The sandbox controller calls MaterializeContainerEnv from buildSubContainerSpec, and nothing else in controllers/ calls MaterializeEnv. So the rebase didn't add a path that skips the typed field.
My verdict and my reason for not recommending approval are the same as before. This PR changes how secrets reach containers, and it sits on #1458, which is still a draft. A human should still read the transition logic: the covered-key and legacy branches of MaterializeContainerEnv in pkg/secret/materialize.go, and effectiveSecrets in controllers/deployment/launcher.go.
Verdict: ready
Since a7a0fa1, the history has been squashed into a single commit, 2522dcc, and #1458's head has moved underneath it. The code in this layer didn't change. pkg/secret/materialize.go, materialize_test.go, pkg/appspec/appspec.go, controllers/deployment/specs_match_test.go and pkg/nodecaps/nodecaps.go have the same blob SHAs at both heads. The launcher.go, sandbox.go and schema hunks are the ones I reviewed last round. The squashed commit message matches the code: it says the upgrade doesn't roll anything and explains why SecretsTyped isn't compared. There are no new comments or replies, and both of my threads are already resolved.
I also looked at how a reused pre-upgrade pool gets written back. On pool reuse, ensurePoolForService updates only SandboxSpec.Version and the version refs before updatePool re-encodes it (launcher.go, the reuse branch). The legacy spec keeps its sentinels and gains an explicit secrets_typed=false. On the runner that means the same thing as an absent marker, so those sandboxes still take the legacy branch of MaterializeContainerEnv, as intended.
Nothing in this layer blocks it. I'm still not recommending approval, for the same reasons as before. It changes how secrets reach containers, and it sits on #1458, which is still a draft. A human should read the transition logic: the covered-key and legacy branches of MaterializeContainerEnv in pkg/secret/materialize.go, and effectiveSecrets in controllers/deployment/launcher.go.
Verdict: ready
a7a0fa1 changes the behaviour instead of rewording the upgrade note, and that's the better fix. specsMatch now compares effectiveSecrets on both sides (launcher.go:1072). For a spec that predates the typed field, that function reads the sentinels in env back as the secrets they name. A pre-upgrade pool therefore matches the spec the launcher rebuilds for it: env matches because Build still writes the sentinel, and the effective secrets match. The minutely resync no longer rolls apps that have secrets, and disk services no longer drain on upgrade. TestSpecsMatchReadsLegacySentinelsAsSecrets checks the match in both directions, and it checks that a rotated ref still rolls the pool. The same specsMatch backs both findMatchingPool and the stale-pool reaping path at launcher.go:1850, so reuse and reaping agree. The changelog line is gone, and the description and commit message now say the upgrade doesn't roll anything, which matches the code. I'm resolving that thread.
This also answers the two questions I left for a human last round. Not comparing SecretsTyped is now a documented choice at launcher.go:946-949. Leaving old pools running is the point of the change. On the path that remains: a reused pre-upgrade pool keeps cloning its unmarked spec into new sandboxes (sandboxpool/manager.go:392 copies the whole spec), and those resolve sentinels through the legacy branch of MaterializeContainerEnv. While the pin-time rejection of look-alike literals stays, that's safe. When a later release stops writing the sentinel, envVarsEqual will no longer match any legacy pool's env, so those pools retire on their own before the rejection can safely go. That release should keep that order, but nothing here needs to change for it.
I found nothing that blocks this. I'm not recommending approval, because this layer changes how secrets reach containers and sits on #1458, which is still a draft. A human should read the transition logic, mainly the covered-key and legacy branches of MaterializeContainerEnv in pkg/secret/materialize.go and effectiveSecrets in controllers/deployment/launcher.go.
Posted to the PR's comment threads when you submit.
a7a0fa1 this is fixed in the code rather than the wording. effectiveSecrets reads a pre-upgrade pool's sentinels back as typed secrets, so secretsEqual holds on the resync and the pool isn't replaced. TestSpecsMatchReadsLegacySentinelsAsSecrets checks the match in both directions and checks that a rotation still rolls the pool. The changelog line is gone, and the description and commit message now say the upgrade doesn't roll anything, which is what the code does. Thanks, I'm resolving this.Verdict: ready
The head moved from f8f82f4 to e461c11, and this time the diff changed. appspec.Build now drops any config entry that an ExtraEnv key overrides, before it builds the typed secret list. That removes the typed secret and its sentinel or literal for that key together. The ExtraEnv value is then the only entry left, so old and new runners resolve the key the same way, and MaterializeContainerEnv's covered-key skip has nothing of ExtraEnv's to drop. TestBuildExtraEnvOverridesASecret checks both the trimmed secret list and the value that reaches the container. That settles my materialize.go thread, and I'm resolving it.
The upgrade note is still wrong (changelog.md:17). It, the commit message ("rolls once on its first deploy after the upgrade") and the PR description all still say the roll waits for a deploy or env change. The launcher path is unchanged. On the minutely resync, findMatchingPool rejects the pre-upgrade pool because secretsEqual fails, a new pool is created, and reapStaleStatelessPools retires the old one. Disk services drain the old pool first. So apps with secrets roll on their own shortly after the coordinator upgrades.
I'm not recommending approval. The note is inaccurate, and two rollout questions need a human's judgment:
SecretsTyped out of specsMatch the intended trade-off? A reused pre-upgrade pool keeps creating sandboxes from its unmarked spec, so those still resolve sentinels in env. That stays safe only while the pin-time rejection of look-alike literals remains in place.Posted to the PR's comment threads when you submit.
e461c11 this is settled in Build, where I'd hoped it would go. Before the typed list is built, any config key named in ExtraEnv is deleted from envMap. That takes out the typed secret and its sentinel together, so the covered-key skip in MaterializeContainerEnv never meets an ExtraEnv literal it would drop. TestBuildExtraEnvOverridesASecret checks both the trimmed secret list and that the ExtraEnv value wins. Thanks, I'm resolving this one.e461c11. The note still says the replacement waits for "first deploy or env change". The commit message and the PR description make the same claim. The launcher's resync, secretsEqual, reapStaleStatelessPools path is unchanged, so pools holding secrets roll soon after the coordinator upgrades. Disk services drain the old pool first.Verdict: ready
The head moved again, from 8ca0bb2 to f8f82f4. As far as I can see this layer's diff hasn't changed, so this looks like another rebase onto #1458. Nobody has commented in the conversation or replied on either thread, so my verdict is the same: ready for a human to review, but I wouldn't recommend merging without one.
Both of my earlier concerns still stand:
changelog.md:17) is wrong about when apps roll. It still says the roll happens on the first deploy or env change, but the launcher resync rolls pools soon after the coordinator upgrade. The commit message and the PR description make the same claim and need the same correction.ExtraEnv vs. covered-key mismatch (materialize.go:80) is still there. It's still latent.The two questions for the human reviewer haven't changed:
SecretsTyped out of specsMatch the intended trade-off?Posted to the PR's comment threads when you submit.
f8f82f4. The note, the commit message and the PR description all still say the roll waits for a deploy or env change, and the resync path in the launcher hasn't changed.f8f82f4, and the code here is unchanged. It's still latent, and still cheap to settle in Build.Verdict: ready
This layer's code is the same as at 128108f; the force-push to 8ca0bb2 looks like a rebase onto the updated #1458. Nobody has replied on either thread or in the PR conversation, and both of my earlier concerns still stand. My verdict hasn't changed: ready for a human to review, but not something I'd recommend merging without one.
changelog.md:17). On every resync the launcher rebuilds the spec, findMatchingPool rejects pools that have no Secret entries, and reapStaleStatelessPools and specsMatch at launcher.go:1825 retire them. So the roll comes on the first resync after the coordinator upgrade, not "on its first deploy or env change". Disk-backed services still drain the old pool before the new one exists. The commit message ("rolls once on its first deploy after the upgrade") and the PR description make the same claim, so correct those along with the note.ExtraEnv vs. covered keys (materialize.go:80) still stands. It's still latent, because neither the launcher nor the run controller sets ExtraEnv.The rest of this layer held up. Pool and run sandboxes copy the whole spec, so Secret and SecretsTyped reach the runner together. On the runner, resolved secrets are appended after PORT/ADMIN_TOKEN and before the controller adds its own variables. That ordering can't shadow anything, because Build already drops system and reserved keys from config env.
For the human reviewer, two questions remain:
SecretsTyped out of specsMatch (launcher.go:945) the intended trade-off?Posted to the PR's comment threads when you submit.
8ca0bb2. The note still says the replacement waits for "first deploy or env change". The launcher path is unchanged: a resync rebuilds the spec, secretsEqual rejects the old pool, and reapStaleStatelessPools retires it, with disk services draining first. The commit message and the PR description make the same deploy-only claim, so they need the same correction.8ca0bb2. MaterializeContainerEnv still drops every env entry with a covered key, and Build still appends ExtraEnv after config env without pruning the typed entry. It's still latent, and still cheap to settle in Build.Verdict: ready
This is ready for a human to look at, but the new upgrade note gets wrong when instances are replaced, and that should be fixed before it ships. The code does what the ticket asks for this stage. appspec.Build writes each secret both as a typed entry and as a sentinel. A runner that sees secrets_typed resolves only the typed list and leaves env literal. A spec without the marker takes the legacy path. Ownership enforcement is kept because both paths go through the same materializer.resolve. TestBuildSecretsFollowEnvPrecedence checks that a task's literal replaces a secret outright instead of leaving a typed entry behind, which was the case I most expected to break.
The upgrade note is wrong about when the replacement happens (inline on changelog.md:17). It says an app with secrets replaces its instances "on its first deploy or env change after upgrading". The launcher doesn't wait for either:
Reconcile rebuilds the desired spec on every pass, including the steady-state resync that launcher.go:525 and :549 call "minutely".Secret entries, so findMatchingPool fails secretsEqual and a new pool is created.reapStaleStatelessPools then retires the old pool. Its own comment (launcher.go:385-394) describes exactly this case: a binary change, not a new AppVersion, altering the baked spec.So every app with a secret rolls within about a minute of the coordinator upgrade, with no operator action. Services with disks go through drainStaleDiskPools first, which scales the old pool down before the new one exists. That's a serving gap, not a rolling cutover. Operators need to know this before they upgrade. Either reword the note to say it plainly, including the disk case, or decide the roll should wait for a deploy.
Covered keys drop more than the sentinel (inline on materialize.go:80). MaterializeContainerEnv drops every env entry whose key a typed secret names, not just the sentinel standing in for it. Build appends opts.ExtraEnv after config env, and its doc says that ordering is deliberate. So an ExtraEnv entry that shares a key with a config secret loses to the secret on a new runner. On an old runner it wins, because containerd's WithEnv keeps the later entry. Neither the launcher nor the run controller sets ExtraEnv today, so this isn't live yet. It's cheap to settle in Build before the sentinel goes away.
For the human reviewer: I'm not recommending approval. This changes how secrets reach containers and triggers a cluster-wide roll on upgrade, and both deserve a person's sign-off. The specific questions:
SecretsTyped exclusion in specsMatch (launcher.go:945) the intended trade-off?As far as I could see, MaterializeEnv now has no non-test callers. If the later release is going to remove it, it can go then.
appspec.Build appends opts.ExtraEnv after config env, and its doc says that ordering is deliberate. So if an ExtraEnv entry shares a key with a backend-sourced config var, this runner drops the ExtraEnv literal and appends the resolved secret. An older runner given the same spec gives the ExtraEnv value instead, because oci.WithEnv lets the later entry win. Neither the launcher nor the run controller passes ExtraEnv today, so it's latent. I'd still settle it in Build: when an ExtraEnv key overrides a config secret, drop that typed entry and its sentinel, the same way you already do for task literals. Then both runner generations agree, and the behaviour holds once the sentinel goes away.launcher.go:525, :549) rebuilds the desired spec with appspec.Build. The existing pool has no Secret entries, so findMatchingPool fails secretsEqual, a new pool is created, and reapStaleStatelessPools retires the old one. launcher.go:385-394 describes exactly this case: a binary change rather than a new AppVersion. So every app with a secret rolls within about a minute of the coordinator upgrade. Services with disks take drainStaleDiskPools first, which scales the old pool down before the new one exists, so they get a serving gap. Please reword this to say that plainly, disk case included. Or, if you'd rather the roll wait for the next deploy, that needs a code change.Verdict: ready