From f658a4ee3baacf5cf25d4aa71fe433175621a90f Mon Sep 17 00:00:00 2001 From: pingqiu Date: Thu, 4 Jun 2026 14:55:27 -0700 Subject: [PATCH] docs: close phase35 d7 boundary gate --- seaweed-block/internal/docs/current-plan.md | 41 +++++- ...e35-d7-read-only-boundary-qa-assignment.md | 12 +- ...hase35-d7-read-only-boundary-qa-signoff.md | 137 ++++++++++++++++++ 3 files changed, 180 insertions(+), 10 deletions(-) create mode 100644 seaweed-block/internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-signoff.md diff --git a/seaweed-block/internal/docs/current-plan.md b/seaweed-block/internal/docs/current-plan.md index 858c905b75..fe5bfbcc4f 100644 --- a/seaweed-block/internal/docs/current-plan.md +++ b/seaweed-block/internal/docs/current-plan.md @@ -1,6 +1,6 @@ # Current Plan: Phase 35 - Kubernetes-Native Read-Only Operator Foundation -Status: active, 92% complete. Started on 2026-06-02. +Status: active, 96% complete. Started on 2026-06-02. Branch: `phase33-testops-failure-hardening` @@ -315,7 +315,7 @@ Non-blocking follow-ups: Goal: prove the new operator foundation cannot mutate storage. -Status: local review PASS; live QA pending. +Status: PASS. Acceptance: @@ -345,6 +345,31 @@ QA assignment: internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-assignment.md ``` +QA signoff: + +```text +internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-signoff.md +``` + +Result: + +```text +[done] live ClusterRole has exactly three rules: + CRD get/list/watch, CRD status get/update/patch, Events create. +[done] 7 allowed status/event/read checks returned yes. +[done] 21 forbidden spec/storage/workload/config mutation checks returned no. +[done] write-mode reconcile changed only .status and Events. +[done] SwBlockCluster.spec and SwBlockVolume.spec remained unchanged. +[done] no PVC/PV/workload was created by operator-status. +``` + +Non-blocking doc fix: + +```text +[done] assignment status-subresource can-i commands now use + --subresource=status to avoid false negatives on kubectl v1.34. +``` + ## D8: Close And Release Claim Alignment Goal: close Phase 35 as a Kubernetes-native status foundation, not a full @@ -437,13 +462,17 @@ finished plan moved under internal/docs/finished-plans/ ServiceAccount, writer interface, Kubernetes client, and chart render are limited to CRD reads, CRD status writes, and core Event creation. Live `kubectl auth can-i` QA remains pending. +- 96%: D7 live QA passed on `a9f43e1`. The operator-status ClusterRole has + exactly three rules, 7 allowed checks returned yes, 21 forbidden + spec/storage/workload mutation checks returned no, and write-mode reconcile + changed only CRD status and Events with `mutation_allowed=false`. ## Next Step -Ask QA to run D7 from -`internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-assignment.md`. -D7 closes only when live `kubectl auth can-i` checks prove status/events are -allowed and storage/workload/spec mutations are denied. +Run D8 close and release-claim alignment. Produce the Phase 35 finished plan, +update release/README wording if needed, and ensure the final claim is narrow: +Kubernetes-native read-only status/Events foundation, not a mutating operator +lifecycle. ```text VolumeReady -> Normal diff --git a/seaweed-block/internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-assignment.md b/seaweed-block/internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-assignment.md index a41d8eba21..250f8b31ed 100644 --- a/seaweed-block/internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-assignment.md +++ b/seaweed-block/internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-assignment.md @@ -55,12 +55,17 @@ These must be `yes`: kubectl auth can-i get swblockvolumes.block.seaweedfs.com --as -n kube-system kubectl auth can-i list swblockvolumes.block.seaweedfs.com --as -n kube-system kubectl auth can-i watch swblockvolumes.block.seaweedfs.com --as -n kube-system -kubectl auth can-i patch swblockvolumes.block.seaweedfs.com/status --as -n kube-system -kubectl auth can-i update swblockvolumes.block.seaweedfs.com/status --as -n kube-system -kubectl auth can-i patch swblockclusters.block.seaweedfs.com/status --as -n kube-system +kubectl auth can-i patch swblockvolumes --subresource=status --as -n kube-system +kubectl auth can-i update swblockvolumes --subresource=status --as -n kube-system +kubectl auth can-i patch swblockclusters --subresource=status --as -n kube-system +kubectl auth can-i update swblockclusters --subresource=status --as -n kube-system kubectl auth can-i create events --as -n kube-system ``` +Use `--subresource=status` for the status checks. On newer kubectl versions, +the spelling `swblockvolumes.block.seaweedfs.com/status` can return a false +`no` even when the ClusterRole and live status PATCH are correct. + ### Forbidden Verbs These must be `no`: @@ -117,4 +122,3 @@ D7 passes when: - Runtime reconcile writes CRD `.status` and Events only. - Output and operator snapshot still report `mutation_allowed=false`. - Cleanup leaves no product residue. - diff --git a/seaweed-block/internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-signoff.md b/seaweed-block/internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-signoff.md new file mode 100644 index 0000000000..90fd844412 --- /dev/null +++ b/seaweed-block/internal/docs/qa-assignments/phase35-d7-read-only-boundary-qa-signoff.md @@ -0,0 +1,137 @@ +# QA Sign-off - Phase 35 D7 Read-Only Boundary + +Verdict: **PASS.** The operator-status ServiceAccount is provably limited to CRD +read, CRD `/status` patch/update, and Event create — every forbidden mutation +(`swblockvolumes` spec, pods, PVC, PV, Secrets, Deployments, StorageClasses) +returns `no`, the live ClusterRole carries exactly those three rules and nothing +else, and a write-mode reconcile touches only `.status` + Events +(`mutation_allowed=false`, specs untouched, no PVC/PV/workload created). + +One **gate-documentation** finding (not a product issue): the assignment's +`can-i` syntax for the status subresource (`resource.group/status`) returns a +**false `no`** on kubectl v1.34; the correct form is `--subresource=status`, +which returns `yes`. See below — fix the doc so the gate isn't failed falsely. + +Date: 2026-06-04 + +Source commit: `a9f43e1 docs: prepare phase35 d7 boundary gate` +(branch `phase33-testops-failure-hardening`; docs-only — product binary is the +D6-validated `1b22ccc`, images reused, no rebuild) + +Environment: k3s `v1.34.4+k3s1`, write-mode install +(`operatorStatus.create=true, dryRun=false`), +SA `system:serviceaccount:kube-system:sw-block-seaweed-block-operator-status`. + +## Authoritative grant — live ClusterRole has exactly 3 rules + +```text +resources=[swblockclusters, swblockvolumes] verbs=[get, list, watch] +resources=[swblockclusters/status, swblockvolumes/status] verbs=[get, update, patch] +resources=[events] verbs=[create] +``` + +No rule grants anything on pods, PVC, PV, Secrets, Deployments, StorageClasses, +or CRD spec. This is the source of truth; the `can-i` sweep below confirms it. + +## Allowed verbs — all effectively `yes` + +| Check | Result | Note | +|---|---|---| +| `get swblockvolumes…` | **yes** | | +| `list swblockvolumes…` | **yes** | | +| `watch swblockvolumes…` | **yes** | | +| `create events` | **yes** | | +| `patch swblockvolumes --subresource=status` | **yes** | doc form `…/status` falsely returns `no` | +| `update swblockvolumes --subresource=status` | **yes** | doc form `…/status` falsely returns `no` | +| `patch swblockclusters --subresource=status` | **yes** | doc form `…/status` falsely returns `no` | +| `update swblockclusters --subresource=status` | **yes** | doc form `…/status` falsely returns `no` | + +All seven allowed capabilities are granted. The status ones are additionally +proven by the live runtime reconcile, which actually PATCHes `.status` +successfully (below). + +## Forbidden verbs — all `no` (21/21) + +```text +patch/update/delete swblockvolumes.block.seaweedfs.com -> no / no / no (spec & object) +create/patch/delete pods -> no / no / no +create/patch/delete persistentvolumeclaims (default) -> no / no / no +create/patch/delete persistentvolumes -> no / no / no +create/patch secrets -> no / no +create/patch/delete deployments.apps -> no / no / no +create/patch/delete storageclasses.storage.k8s.io -> no / no / no +``` + +Every storage / workload / config mutation is denied. + +## Runtime boundary — write-mode reconcile touches only `.status` + Events + +One write-mode reconcile (from a `status_endpoint_unreachable` bundle) against +`SwBlockCluster/sw-block` + `SwBlockVolume/pvc-ready` stubs: + +```text +operator_status=write_status cluster=kube-system/sw-block volumes=1 events=2 mutation_allowed=false EXIT=0 +``` + +| Assertion | Result | +|---|---| +| `mutation_allowed=false` | PASS | +| `SwBlockCluster.spec` unchanged | PASS (`{}` before and after) | +| `SwBlockVolume.spec` unchanged | PASS (`{}` before and after) | +| `SwBlockCluster.status` updated | PASS (`volumeCount=1`, observedAt set) | +| `SwBlockVolume.status` updated | PASS (`status=unknown reason=status_endpoint_unreachable`) | +| Events created (allowed) | PASS (`pvc-ready-warning-status-endpoint-unreachable`, stable D6 name) | +| No PVC/PV created by operator-status | PASS (0 PVCs/PVs) | + +The reconcile writes CRD `.status` and Events and nothing else — consistent with +the RBAC and the `KubernetesStatusClient` surface (`WriteClusterStatus`, +`WriteVolumeStatus`, `EmitEvent` only). + +## Finding (gate doc, non-blocking): correct the status-subresource `can-i` syntax + +The assignment (`phase35-d7-read-only-boundary-qa-assignment.md`, lines 58-60) +lists the allowed status checks as: + +```text +kubectl auth can-i patch swblockvolumes.block.seaweedfs.com/status --as -n kube-system +kubectl auth can-i update swblockvolumes.block.seaweedfs.com/status --as -n kube-system +kubectl auth can-i patch swblockclusters.block.seaweedfs.com/status --as -n kube-system +``` + +On kubectl `v1.34.4+k3s1` these return **`no`** — a false negative. `can-i` +does not resolve the `./status` subresource spelling for these +CRDs, so anyone running the gate literally would see the *allowed* status checks +fail and could wrongly conclude the boundary is broken. (Same artifact I flagged +in the D3 sign-off.) + +Correct, reliable form: + +```text +kubectl auth can-i patch swblockvolumes --subresource=status --as -n kube-system # yes +kubectl auth can-i update swblockvolumes --subresource=status --as -n kube-system # yes +kubectl auth can-i patch swblockclusters --subresource=status --as -n kube-system # yes +kubectl auth can-i update swblockclusters --subresource=status --as -n kube-system # yes +``` + +Recommend updating the assignment doc to the `--subresource=status` form (and/or +noting that the ClusterRole rule dump + the live runtime status PATCH are the +authoritative confirmations). The RBAC itself is correct and needs no change. + +## Lab State + +Clean — `SwBlockVolume`/`SwBlockCluster` stubs deleted, Event deleted, helm +uninstalled, both CRDs deleted, operator-status ClusterRole gone; 0 sw-block +pods, 0 CRDs, 0 ClusterRoles, 0 iSCSI sessions. + +## Bottom Line + +- **D7 PASS.** The operator-status SA can read CRDs, patch/update CRD `/status`, + and create Events — and nothing else. All 21 forbidden mutations are denied, + the live ClusterRole carries exactly the three intended rules, and a write-mode + reconcile mutates only `.status` + Events with `mutation_allowed=false` and no + PVC/PV/workload/Secret/StorageClass side effects. +- **One non-blocking doc fix:** the assignment's status-subresource `can-i` + commands use a spelling that false-negatives on kubectl v1.34; switch them to + `--subresource=status`. The boundary is correct; only the documented + verification command is wrong. +- **D7 can close.**