Skip to content

feat(deploy/sbx): SBX_STORAGE_CLASS, one storage class for every claim SBX0 creates - #887

Merged
pdettori merged 5 commits into
mainfrom
feat/sbx-storage-class
Nov 19, 2026
Merged

pdettori merged 5 commits into
mainfrom
feat/sbx-storage-class

Conversation

@galmasi

@galmasi galmasi commented Nov 18, 2026

Copy link
Copy Markdown

What

Low priority — a convenience knob for clusters with no default StorageClass.

On such a cluster (one OpenShift rig this was deployed on), every PVC SBX0 creates sits Pending until an operator patches it by hand — three times over once the template store and the egress credential store are enabled. SBX_STORAGE_CLASS writes one storageClassName into:

  • the redis StatefulSet's volumeClaimTemplates (always rendered)
  • the template store's PVC (only on runs that render it)
  • the egress credential store's PVC (only on runs that render it)

Details

  • Each patch is emitted only when its target resource exists in the render — a JSON6902 patch naming an absent PVC fails the kustomize build, so a successful render of each shape is itself part of the test
  • Fresh claims only: an existing claim keeps the class it was created with; an upgrade from before this knob patches those once by hand (documented in the header)
  • Unset changes nothing: the generated overlay is byte-identical (the golden test in setup.test.sh proves it)
  • The value is validated as a storage-class name (lower-case alphanumerics, - and .) so a typo is named before a pend is

Tests

Refusal for a bad name; positive runs asserting the class on the redis templates (base shape) and on both PVCs (store + egress on); the golden byte-identical check covers the unset shape. setup.test.sh green.

Assisted-By: Claude Code

…m SBX0 creates

A cluster with no default StorageClass (one OpenShift rig this
deployed on) leaves every PVC SBX0 creates Pending until an operator
patches it by hand -- three times over once the template store and the
egress credential store are on. SBX_STORAGE_CLASS writes one
storageClassName into the redis StatefulSet's volumeClaimTemplates and
each component's PVC, on the runs that render them: a patch naming an
absent PVC fails the kustomize build, so the store's and the egress
store's are emitted only with their components on.

Fresh claims only: a claim that already exists keeps the class it was
created with, so an upgrade from before this knob patches those once by
hand. Unset changes nothing (the generated overlay is byte-identical).

Low priority: a convenience knob, not a correctness fix.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: George Almasi <[email protected]>
@pdettori pdettori added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 18, 2026

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The knob works on fresh namespaces with the sandbox profile, and the tests cover that well: the refusal, the base and store+egress shapes, and the golden check that an unset value changes nothing. There are two gaps. (1) On a namespace that already exists, the apply is rejected because the StatefulSet's volumeClaimTemplates can't be changed in place. That's the upgrade case the header documents, and it's the rig this PR was written for. (2) The combined profile's moca-credentials PVC isn't patched. Also, SBX_STORAGE_CLASS isn't in the settings table in deploy/sbx/README.md, which lists the other optional knobs such as SBX_REDIS_IMAGE; it's worth adding a row.

Assisted-By: Claude Code

Comment thread deploy/sbx/setup.sh Outdated
# components are on. Fresh claims only -- a claim that already exists (an upgrade on a
# deployment from before this knob) keeps the class it was created with.
if [[ -n "${SBX_STORAGE_CLASS:-}" ]]; then
printf ' - target: { kind: StatefulSet, name: redis }\n patch: |-\n - { op: add, path: /spec/volumeClaimTemplates/0/spec/storageClassName, value: %s }\n' "$SBX_STORAGE_CLASS"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix: existing namespaces can't apply this. Kubernetes won't let you change volumeClaimTemplates on a StatefulSet that already exists; only replicas, ordinals, template, updateStrategy, PVC retention policy and minReadySeconds can change. On a namespace deployed before this knob, setting SBX_STORAGE_CLASS adds storageClassName to the live redis template, so kc apply -k gets Forbidden and the run dies under set -e before the rollouts and bundles. It keeps failing on every run until the variable is unset.

The rig that motivated this PR is that exact case: deployed, with PVCs patched by hand. The header (lines 79-81) says "patches those once by hand (kubectl patch pvc)", but patching the PVC doesn't help, because the StatefulSet is what's rejected.

Suggested fix: a preflight like check_redis_image. Read the live StatefulSet's .spec.volumeClaimTemplates[0].spec.storageClassName, and if it's set and differs, or unset while SBX_STORAGE_CLASS is set, refuse with the fix: kubectl -n $NS delete sts redis --cascade=orphan, then re-run (the pod and data-redis-0 survive). Then fix the header to match.

Comment thread deploy/sbx/setup.sh
# deployment from before this knob) keeps the class it was created with.
if [[ -n "${SBX_STORAGE_CLASS:-}" ]]; then
printf ' - target: { kind: StatefulSet, name: redis }\n patch: |-\n - { op: add, path: /spec/volumeClaimTemplates/0/spec/storageClassName, value: %s }\n' "$SBX_STORAGE_CLASS"
if [[ -n "$STORE_ON" || -n "$COMBINED" ]]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix: one claim is missed with SBX_PROFILE=combined. ocp-combined also renders pvc-credentials.yaml, the moca-credentials PVC for the harness's file credential store. The patch doesn't cover it, so on a cluster with no default class that claim stays Pending and moca-control-plane never rolls out. That contradicts "every claim SBX0 creates".

Fix: add [[ -z "$COMBINED" ]] || printf ...moca-credentials..., plus a combined-profile case in setup.test.sh §13c that asserts all three PVCs and the redis template.

Comment thread deploy/sbx/setup.sh Outdated
# components are on. Fresh claims only -- a claim that already exists (an upgrade on a
# deployment from before this knob) keeps the class it was created with.
if [[ -n "${SBX_STORAGE_CLASS:-}" ]]; then
printf ' - target: { kind: StatefulSet, name: redis }\n patch: |-\n - { op: add, path: /spec/volumeClaimTemplates/0/spec/storageClassName, value: %s }\n' "$SBX_STORAGE_CLASS"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: value: %s goes into the YAML unquoted. The regex accepts names that YAML reads as non-strings, like 123 or 1e3, and the render would then fail on a type error. Quote it as value: "%s" in all three printfs, the same way the settings-hash patches already do.

… quoted values

Review #887, three required changes:

- A live redis StatefulSet cannot take the knob: volumeClaimTemplates
  are immutable once the StatefulSet exists, so the patch made every
  later apply Forbidden and the run died under set -e before the
  rollouts and bundles -- the exact upgrade case the header documented,
  and the rig this knob was written for. check_storage_class now reads
  the live template's class and refuses a mismatching run (set and
  different, or unset while the knob is set) before anything is
  applied; a fresh namespace, a matching class and an unset knob pass.
  The header says what to do instead: leave the variable unset for that
  deployment, or recreate the StatefulSet and its claim.
- Combined renders a third claim this knob missed (moca-credentials,
  the harness's file credential store, ocp-combined's
  pvc-credentials.yaml): on a no-default-class cluster it stayed
  Pending and the control plane never rolled out. The patch is emitted
  for it too, and a combined test case asserts all of redis's
  templates, the template store's PVC and moca-credentials.
- The patch values are quoted ("%s"), like the settings hashes: a
  name the regex accepts but YAML would read as a non-string must fail
  the render, not silently change type.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: George Almasi <[email protected]>
@galmasi

galmasi commented Nov 18, 2026

Copy link
Copy Markdown
Author

All three required changes addressed in 1d41dd9:

  • must-fix (existing namespaces can't apply this): you were right that patching the PVC doesn't help — the StatefulSet apply itself is Forbidden. check_storage_class now reads the live template's class (the check_redis_image pattern, captured first so a failing get doesn't read as fresh) and refuses a mismatching run before anything is applied: set-and-different, or unset-while-the-knob-is-set. Fresh namespace, matching class, and unset knob pass. The header now says what to do instead of the dead "kubectl patch pvc" advice: leave the variable unset for that deployment, or recreate the StatefulSet and its claim. Four test cases cover the matrix against a seeded live StatefulSet.
  • must-fix (combined's moca-credentials): the patch is emitted for ocp-combined's moca-credentials PVC too, and a combined-profile test case asserts it beside the redis templates and the template store's PVC.
  • nit (unquoted values): all four printfs quote the value (value: "%s"), like the settings-hash patches.

setup.test.sh and overlay.test.sh green.

Assisted-By: Claude Code

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1d41dd9 resolves both earlier must-fixes (the existing-StatefulSet preflight, and combined's moca-credentials) and the quoting nit. One gap remains, the mirror image of the first must-fix: if a later run drops the knob, server-side apply removes the class it owns and gets the same Forbidden, and test 13c' asserts that this case passes. Also, the SBX_STORAGE_CLASS row in the deploy/sbx/README.md settings table (from the first review) is still missing. It's not blocking, but it's worth adding next to SBX_REDIS_IMAGE.

Assisted-By: Claude Code

Comment thread deploy/sbx/setup.sh Outdated
# of a Pending claim is allowed -- but a BOUND one keeps its class, so those are the operator's
# one-time kubectl patch, as the header says.
check_storage_class() {
[[ -n "${SBX_STORAGE_CLASS:-}" ]] || return 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix: the reverse case is still Forbidden. This returns early when the knob is unset. But a live redis template with a class can only have come from an earlier knob run, because base/redis.yaml sets none. The apply is --server-side --field-manager=sbx-setup. If a later run drops SBX_STORAGE_CLASS (say the env file loses the line), SSA removes the storageClassName field that sbx-setup owns. That changes volumeClaimTemplates, so the apply gets the same Forbidden as the forward case, partway through the object stream.

Fix: when the knob is unset, still read the live template, and refuse if live is non-empty, naming the fix (set SBX_STORAGE_CLASS=<live>).

Comment thread deploy/sbx/tests/setup.test.sh Outdated
{ cat "$TMP/out" >&2; fail 'a matching class on an existing StatefulSet was refused'; }
reset_state
redis_sts_class 'ocs-storagecluster-ceph-rbd'
run_setup true || { cat "$TMP/out" >&2; fail 'the knob unset on an existing StatefulSet was refused'; }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix (same issue as setup.sh:673): this case asserts that a live class with the knob unset passes. The mock doesn't model SSA dropping a field the manager no longer applies, so this locks in the behaviour that fails on a real cluster. It should expect a refusal that names the live class.

Comment thread deploy/sbx/setup.sh Outdated
[[ -n "$json" ]] || return 0
live="$(jq -r '.spec.volumeClaimTemplates[0].spec.storageClassName // empty' <<<"$json")"
[[ "$live" == "$SBX_STORAGE_CLASS" ]] ||
die "StatefulSet redis in $NS already exists with volumeClaimTemplates its API refuses to change in place (live class: '${live:-unset}'), so SBX_STORAGE_CLASS=$SBX_STORAGE_CLASS cannot be applied: leave it unset for this deployment (its claims keep the class they were created with), or recreate the StatefulSet (delete the data-redis-0 claim too -- redis data does not survive) and re-run"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: this recovery path deletes data when it doesn't need to ("delete the data-redis-0 claim too -- redis data does not survive"). kubectl -n $NS delete sts redis --cascade=orphan followed by a re-run keeps the pod and data-redis-0: the new StatefulSet adopts both, and the claim keeps the class it already has. On the rig this PR targets, those claims were already hand-patched to the right class. Suggest the orphan path here, and match the header text at line 85.

@pdettori pdettori added this to the v0.11.0 milestone Nov 19, 2026
…e recovery

Review #887, round 2:

- The reverse case is as Forbidden as the forward one: a live redis
  template with a class can only have come from an earlier knob run
  (base/redis.yaml sets none), and the apply is server-side with one
  field manager -- a later run with the knob unset DROPS the
  storageClassName that manager owns, which changes volumeClaimTemplates
  and is refused partway through the object stream. check_storage_class
  no longer returns early when the knob is unset: a non-empty live class
  refuses, naming the fix (keep SBX_STORAGE_CLASS at the live class).
- The test asserted the reverse case passes; the mock cannot model SSA
  dropping an unmanaged field, so it locked in the behaviour that fails
  on a real cluster. It now expects the refusal naming the class, with a
  separate no-live-class case (a deployment from before the knob) that
  still passes.
- The recovery path deletes data it does not need to: kubectl delete
  sts redis --cascade=orphan, then a re-run, keeps the pod and the
  data-redis-0 claim -- the new StatefulSet adopts both, and the claim
  keeps the class it already has. The refusal and the header now say
  the orphan path instead of deleting the claim.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: George Almasi <[email protected]>
@galmasi

galmasi commented Nov 19, 2026

Copy link
Copy Markdown
Author

Round 2 addressed in 8d68ffa — you were right on all three, and the reverse case was a genuine hole in my preflight:

  • must-fix (the reverse case): check_storage_class no longer returns early when the knob is unset. A non-empty live class now refuses, with the message naming the mechanism exactly as you described (SSA drops the field sbx-setup owns → volumeClaimTemplates changes → the same Forbidden, partway through the stream) and the fix (SBX_STORAGE_CLASS=<live>).
  • must-fix (the test): flipped — the live-class-with-knob-unset case now expects the refusal naming the class, and a separate no-live-class case (a deployment from before the knob, the common one) asserts the pass that is actually safe. Agreed the mock can't model SSA field-dropping, so asserting the pass was locking in broken behavior.
  • suggestion (orphan delete): the refusal and the header now give kubectl delete sts redis --cascade=orphan + re-run — the pod and data-redis-0 survive, the new StatefulSet adopts both, the claim keeps its class. Much better than my delete-the-claim advice; on the rig this targets the claims were already hand-patched to the right class, so the orphan path is the zero-data-loss move there too.

setup.test.sh green, shellcheck clean.

Assisted-By: Claude Code

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — the reverse case is fixed; the component claims still aren't preflighted

8d68ffaa is new since the 1d41dd9 draft I wrote on 2026-11-18 (never posted; this review replaces it). It fixes the round-2 must-fix and replaces the destructive recovery advice.

Fixed in this commit

  • The reverse case is now refused. check_storage_class runs unconditionally, reads the live storageClassName and refuses both directions: knob set and differing, and knob unset against a live class — naming the live class as the fix, which is the actionable form because a plain re-run with the knob at the live value is a no-op. The reasoning in the comment is right: the base sets no class, so a live class came from an earlier knob run, and SSA with one field manager would drop the field it no longer owns, which changes volumeClaimTemplates and is Forbidden.
  • The recovery advice is safe now. kubectl delete sts redis --cascade=orphan keeps the pod and the data-redis-0 claim; the re-run's StatefulSet adopts both. The previous text told the operator to delete the claim too ("redis data does not survive"), which was unnecessary data loss.
  • Tests match: the reverse case asserts the refusal and that it names SBX_STORAGE_CLASS=<live>, and a new case keeps "knob unset, no live class" passing — the common pre-knob deployment. CI is 16/16 green.

Still open (carried from the unposted draft)

  • The component claims have the same failure and no preflight. write_overlay patches the class onto moca-sbx-templates, moca-sbx-credentials and moca-credentials (setup.sh:1185-1194), and apply_manifest applies with --server-side --field-manager=sbx-setup (:736, :999) — the same manager, so a run that drops or changes SBX_STORAGE_CLASS removes the field from those claims too. PVC.spec.storageClassName is immutable apart from nil→set, so that is the same Forbidden, one object later in the stream (redis passes, then the claim fails partway through the apply). check_storage_class reads only statefulset redis. Must-fix: read each claim this run renders and refuse the same two directions before applying.
  • SBX_STORAGE_CLASS still has no settings row. The knob is documented only in the header comment. On current main the settings table is docs/operate/sandbox-service/install.md (#916 moved it), so the row belongs there now.

Notes: the branch is ~100 commits behind main but merges cleanly (mergeable: MERGEABLE, no conflict in git merge-tree); CI at this head ran against the older base, so a re-run after a rebase would be worth having.

Author: pdettori (MEMBER — maintainer). Agent/IDE config: none. Commits: 3, all signed off.

Comment thread deploy/sbx/setup.sh
if [[ -n "${SBX_STORAGE_CLASS:-}" ]]; then
printf ' - target: { kind: StatefulSet, name: redis }\n patch: |-\n - { op: add, path: /spec/volumeClaimTemplates/0/spec/storageClassName, value: "%s" }\n' "$SBX_STORAGE_CLASS"
if [[ -n "$STORE_ON" || -n "$COMBINED" ]]; then
printf ' - target: { kind: PersistentVolumeClaim, name: moca-sbx-templates }\n patch: |-\n - { op: add, path: /spec/storageClassName, value: "%s" }\n' "$SBX_STORAGE_CLASS"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix: these three claims get the class from the same field manager as the StatefulSet (apply_manifest uses --server-side --field-manager=sbx-setup, :736 and :999), but nothing preflights them. A run that drops or changes SBX_STORAGE_CLASS makes SSA remove storageClassName from moca-sbx-templates, moca-sbx-credentials (here) and moca-credentials (:1194), and PVC.spec.storageClassName is immutable apart from nil→set — the same Forbidden the redis check now refuses, only one object later in the stream: redis passes the preflight and the apply then fails partway through.

check_storage_class can cover them the same way, for each claim this run renders (STORE_ON/EGRESS_ON/COMBINED): kc get pvc <name> -n "$NS" --ignore-not-found -o json, then jq -r '.spec.storageClassName // empty', refusing a set-knob mismatch and an unset knob against a live class. Fresh deployments still pass, and it keeps the "refuse before anything is applied" property the header promises.

George Almasi added 2 commits November 19, 2026 11:55
PVC.spec.storageClassName is immutable once set (the API allows only nil
to set), and the render's patches apply with the same field manager as
the redis one, so a run whose knob disagrees with a live claim this run
renders was the same Forbidden one object later in the stream -- redis
applied, then the claim failed partway through. check_storage_class now
reads each claim this run renders (rendered_pvc_claims mirrors
write_overlay's patch conditions, so an unrendered claim is neither
patched nor read) and refuses both directions before anything is
applied: set and differing, and unset against a class an earlier knob
run set (server-side apply would drop the field its manager owns). A
classless claim passes against a set knob -- nil to set is the one
transition the API allows.

Also the SBX_STORAGE_CLASS row in the settings table
(docs/operate/sandbox-service/install.md, where #916 moved it from the
README), and main merged in so the row lands where the table now lives.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: George Almasi <[email protected]>
@galmasi

galmasi commented Nov 19, 2026

Copy link
Copy Markdown
Author

Round 3 addressed in 265c747 (after merging current main in, so CI runs against the new base and the settings row lands where #916
moved the table):

  • must-fix (the component claims): check_storage_class now reads each claim this run renders - rendered_pvc_claims mirrors
    write_overlay's patch conditions exactly (moca-sbx-templates on store or combined, moca-sbx-credentials on egress,
    moca-credentials on combined), so a claim this run does not render is neither patched nor read, and the two lists cannot drift.
    check_claim_class refuses both directions before anything is applied: set-and-differing (PVC spec.storageClassName is immutable
    apart from nil#set), and unset-against-a-live-class (the same SSA field-drop, one object later in the stream - redis applies, then
    the claim fails). A classless claim passes against a set knob, since nil#set is the one transition the API allows. The header and
    the stale comment that claimed the component PVCs "carry no such constraint" are corrected; recovery advice for a claim is
    kubectl delete pvc (contents do not survive), kept distinct from redis's orphan-delete.
  • docs row: SBX_STORAGE_CLASS is now in the settings table in docs/operate/sandbox-service/install.md, next to SBX_REDIS_IMAGE.

Tests: a 13c''' matrix against seeded live PVCs (both refusals before any apply, matching and classless pass, and a claim the run
does not render is never read - asserted on the mock's argv log), plus a combined case refusing on a live moca-credentials. The mock
kubectl gained a get pvc case. setup.test.sh 77/77, overlay.test.sh and overlay-combined.test.sh green, prettier clean.

Assisted-By: Claude Code

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — fix(deploy/sbx): SBX_STORAGE_CLASS preflights the component claims too

The must-fix from the last round is addressed, in the shape I hoped for. rendered_pvc_claims mirrors write_overlay's three conditions exactly (STORE_ON || COMBINED → moca-sbx-templates, EGRESS_ON → moca-sbx-credentials, COMBINED → moca-credentials), check_claim_class runs in preflight before anything is applied, and nil → set is correctly the one allowed direction. The failure is refused on the same field manager and the same object stream as before, so the mid-apply Forbidden is gone.

  • The tests cover both refusal directions on a claim, the matching and classless passes, combined's own moca-credentials, the "claim this run does not render is neither patched nor read" case, and that a refusal applies nothing (the mock log check). The settings row now lives in docs/operate/sandbox-service/install.md where #916 moved the table.
  • The merge of main is clean, and the earlier round's items (reverse case for redis, orphan-delete guidance) survive it. CI 18/18.

One suggestion inline about the reverse direction on a PVC: the live class is not necessarily one sbx-setup set, and the refusal (and its message) should be exact about whose field it is.

Author: galmasi (MEMBER — maintainer).

Comment thread deploy/sbx/setup.sh
[[ "$live" == "$SBX_STORAGE_CLASS" ]] ||
die "PVC $1 in $NS already exists with storageClassName '$live', which the API refuses to change in place (PVC.spec.storageClassName is immutable, apart from nil to set), so SBX_STORAGE_CLASS=$SBX_STORAGE_CLASS cannot be applied: keep SBX_STORAGE_CLASS=$live for this deployment (the claim keeps the class it was created with), or, to change it, kubectl -n $NS delete pvc $1 (its contents do not survive) and re-run"
else
die "PVC $1 in $NS carries storageClassName '$live' an earlier SBX_STORAGE_CLASS run set, and this run has SBX_STORAGE_CLASS unset: the apply would remove the field (server-side apply drops what its field manager no longer owns), which the API refuses on a set class. Set SBX_STORAGE_CLASS=$live (the claim keeps that class either way)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: this reverse direction assumes the live class is one sbx-setup set, which is not true for a PVC. The manifests leave storageClassName out, so on a cluster with a default StorageClass the admission plugin fills it at creation; and an operator who patched a Pending claim by hand (the remedy this header documented before the round-2 change) leaves the field owned by kubectl-patch or whichever tool patched it. Server-side apply drops only fields the applying manager previously owned and no longer specifies, so for a claim whose class belongs to another manager this refuses a run that would have succeeded — and the message's "an earlier SBX_STORAGE_CLASS run set" then names a cause that did not happen. metadata.managedFields on the live claim settles it exactly: refuse only when the entry with manager: sbx-setup owns f:spec/f:storageClassName (that is also the only case where the drop is real). A test with a foreign-owned class would pin the intended behaviour; if the strict refusal is deliberate instead, the message should say the class may come from the cluster's default StorageClass, not only from a knob run.

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pdettori
pdettori merged commit bc283e2 into main Nov 19, 2026
17 checks passed
@pdettori
pdettori deleted the feat/sbx-storage-class branch November 19, 2026 20:27
pdettori pushed a commit that referenced this pull request Nov 20, 2026
…r knob run applied

With SBX_STORAGE_CLASS unset, check_claim_class refused any live claim
that carried a storageClassName, as 'set by an earlier SBX_STORAGE_CLASS
run'. On a cluster with a default StorageClass, the DefaultStorageClass
admission plugin fills that class in when the claim is created, so every
deployment set up before #887 was refused at its next setup.sh.

The claims come from the overlay, which apply_stack applies client-side
(kubectl apply -k); its three-way merge removes a field only when the
last-applied-configuration annotation has it and the new config does
not. A class admission filled in is on the claim but not in that
annotation, so a knob-unset apply leaves it alone. Refuse only when the
annotation carries the class (an earlier knob run applied it); log the
kept class otherwise; and refuse, fail-closed, when the annotation is
there but not valid JSON, since the run can't tell who set the class. A
set knob that differs is still refused. The StatefulSet half is
unchanged: admission does not fill volumeClaimTemplates.

Closes #935

Assisted-By: Claude Code
Signed-off-by: Rong Chang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants