fix(deploy): keep the scaffold's pod spread in lockstep with the platform#88
Conversation
…form The platform's spread-pods ClusterPolicy injects its topology spread constraint through Kyverno's add-if-not-present anchor '+(topologySpreadConstraints)'. The scaffold authors its own constraint, so that mutation never fires and the scaffold's block is what runs -- including the DoNotSchedule hazard, but WITHOUT the matchLabelKeys: [pod-template-hash] guard the platform deliberately added to stop rolling updates deadlocking (surge pods of the new revision otherwise count against the old revision's skew). Only bites at 2+ replicas, which the scaffold's own comment invites. Adds the key, and a CI step that reads the expectation from the platform's LIVE policy so the two cannot drift apart again. Fixes #87
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 200d6040cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The four-field projection silently discarded any field it did not name, so the day the platform adds minDomains / nodeAffinityPolicy / nodeTaintsPolicy the gate would stay green while the scaffold diverged -- defeating the drift check in exactly the scenario it exists for. Compare the complete constraint instead, normalising away only labelSelector (genuinely different spelling, identical selection) and sorting keys so authoring order on either side does not matter. Addresses the P1/P2 review finding on #88.
P2 confirmed and fixed in Now compares the complete constraint, normalising away only RED/GREEN-proved by executing the embedded
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bcb6a1735b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Both round-2 P2s are CORRECT and remain OPEN — this PR stays a draftRecording the state honestly rather than promoting on a partial fix. Both findings are valid, and both are the same defect shape as round 1 — my check keeps measuring a projection instead of the property:
Why it is not fixed in this push. I attempted the full fix (compare whole arrays; canonicalise
Shipping that would be the third iteration of the very defect being reported — a comparison routine that is itself subtly wrong. So I reverted to the pushed state and left it here. Current head |
…shapes The lockstep gate read only `[0]` and deleted `labelSelector` outright, so it was blind to two real drifts: the platform adding a second constraint the scaffold never inherits, and the platform changing which pods its selector counts. Compare the full arrays, and assert each side's selector against the shape hand-verified equivalent rather than canonicalising two shapes into one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
User-evaluation at head
Each fixture was derived from the live source plus exactly one delta, with the Non-vacuity: the previous version of this step stays green on drifts 1, |
Why
Tenants built from this template can hit a stalled rolling update the moment they scale past one replica — which the scaffold itself invites ("a scale-up to 2-3 replicas is actually drain-safe").
The platform already solved this. Its
spread-podspolicy adds a guard that scopes pod spreading per deployment revision, so a rolling update's new pods are not counted against the old ones. But that policy only applies when a workload has no spread rule of its own — and this scaffold ships one. So the scaffold quietly opts every tenant out of the platform's fix while keeping the strict scheduling rule the fix exists to make safe.What
Brings the scaffold's spread rule in line with the platform's, and adds a CI check that compares the two against the platform's live policy — so if the platform changes its remedy, this repo goes red instead of silently drifting again.
Fixes #87 · Part of #6