Repository navigation
fix: add Kubernetes resource-only teardown - #114953
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 5:49 AM ET / 09:49 UTC. ClawSweeper reviewWhat this changesThis PR makes Merge readiness⛔ Blocked until stronger real behavior proof is added - 4 items remain The PR remains necessary: current Priority: P1 Review scores
Verification
How this fits togetherThe Kubernetes deployment script turns an operator-selected namespace and teardown option into flowchart TD
A[Operator namespace and teardown option] --> B[Kubernetes deploy script]
B --> C[Teardown mode selection]
C --> D[Default namespace deletion]
C --> E[Custom namespace resource deletion]
D --> F[Namespace and all workloads removed]
E --> G[OpenClaw resources and Secret removed]
E --> H[Unrelated workloads preserved]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +185, Docs +16, Other +27. Total +228 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the approved split between safe custom-namespace teardown and explicit full namespace deletion, then add redacted exact-current-head k3s evidence for both paths before merge. Do we have a high-confidence way to reproduce the issue? Yes for the pre-fix behavior: current Is this the best way to solve the issue? Yes, conditionally: one resource-only branch for custom namespaces plus an explicit namespace-wide mode is a coherent repair of the shared-namespace deletion bug. It needs current-head cluster proof before merge because the CLI compatibility change is intentional and operator-visible. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b7bbb4f98a1f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (24 earlier review cycles; latest 8 shown)
|
ede12e0 to
732a52b
Compare
d9cad2d to
9d9b2b6
Compare
9d9b2b6 to
b315c0f
Compare
|
@clawsweeper re-review Real k3s proof for exact head |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Maintainer decision context: issue #112307 also links #113469, but the two PRs make different compatibility choices rather than being identical patches.
The remaining choice is therefore the public CLI compatibility policy: preserve existing automation and add a separate safe command (this PR), or intentionally change the default meaning of |
|
@sallyom Would you be able to advise on the Kubernetes teardown CLI contract here, since you originally introduced and maintain this deployment surface? |
…-114953-author-refresh
* fix: add Kubernetes resource-only teardown * fix(k8s): preserve shared namespaces on teardown --------- Co-authored-by: Peter Steinberger <[email protected]>
Closes #112307
Maintainer decision (founder-approved)
Maintainer decision: for non-default/custom namespaces,
--deleteintentionally now removes only OpenClaw-managed resources and its generated Secret; this changes the previous destructive custom-namespace behavior to prevent deleting unrelated workloads. Default dedicated namespace--deletestill deletes the namespace. Operators requiring full custom-namespace deletion must explicitly pass--delete-namespace; PVC data follows the storage class/PV reclaim policy. This supersedes the earlier compatibility wording and addresses ClawSweeper’s Rank-up move.What Problem This Solves
Kubernetes operators need a teardown path that removes OpenClaw from a shared or custom namespace without deleting unrelated workloads that live in the same namespace.
Why This Change Was Made
For the default dedicated OpenClaw namespace,
--deletepreserves full namespace teardown. For every non-default/custom namespace,--deleteintentionally changes the earlier destructive behavior: it removes only the OpenClaw Deployment, Service, PVC, ConfigMap, and generated Secret without deleting the Namespace object or unrelated workloads.--delete-resourcesremains an explicit resource-only alias;--delete-namespaceis the explicit full-namespace opt-in.--delete-namespaceexplicitly requests full namespace teardown, including when the selected namespace is non-default/custom.User Impact
Operators using the default dedicated namespace retain the existing full-namespace
--deletebehavior. Operators using non-default/custom namespaces now get safe resource-only teardown from--deleteor--delete-resources; full custom-namespace deletion requires explicit--delete-namespace. PVC data retention or deletion depends on the storage class/PV reclaim policy. Namespaced delete failures still surface fromkubectl.Evidence
17262b9c2eee4bd2f48c08966d474b90027cbae5.mainatc3fba2bb200dce2032ede088f49d57d5d585cbeabefore push.30367643141completed green (openclaw/ci-gatepassed; 76 checks passed, 0 failed): https://github.com/openclaw/openclaw/actions/runs/30367643141node scripts/run-vitest.mjs test/scripts/k8s-deploy.test.ts: 1 file passed, 4 tests passed.bash -n scripts/k8s/deploy.shpassed.git diff --check c3fba2bb200dce2032ede088f49d57d5d585cbea...HEADpassed.node_modules/oxfmt/bin/oxfmt --check scripts/k8s/deploy.sh docs/install/kubernetes.md test/scripts/k8s-deploy.test.tspassed.mainat206f989069fb7b5b3854fb490fc95e65c486b99binto this head without conflicts or target/dependency path overlap; the focused test passed 4/4,bash -npassed, and both-directiongit diff --checkpassed. The branch itself remains unchanged.Historical original-contributor Kubernetes proof (prior head)
The original contributor validated the historical prior head
17262b9c2eee4bd2f48c08966d474b90027cbae5on 2026-07-28 against a disposable local k3sv1.36.2+k3s1cluster with a real Ready node and containerd runtime. The shared namespace contained an unrelated Deployment and ConfigMap. The sentinel Deployment was1/1 Runningbefore and after teardown. No real credentials were used; the OpenClaw Secret contained only a disposable proof token, and no secret value is shown.The cluster used a locally imported minimal pause image for the unrelated sentinel because outbound registry requests timed out. The sentinel Pod itself was confirmed
1/1 Running; the proof validates real Kubernetes object and workload preservation rather than a stubbed command path.Historical prior-head full-namespace proof
On the historical contributor head, the previous
--deleteimplementation was exercised against the same real k3s API using a separate namespace containing a marker ConfigMap; this output documents the old destructive custom-namespace behavior, which the founder-approved current change intentionally replaces:This historical output demonstrates why the current implementation intentionally changes custom-namespace
--delete: only the default dedicated namespace retains implicit full deletion; custom namespaces require explicit--delete-namespace.Additional validation
autoreviewremains blocked before a structured verdict because the review engine receives HTTP 403 (Country, region, or territory not supported) from the OpenAI Responses API. ClawSweeper accepted the historical k3s proof on the preceding head; its earlier compatibility Rank-up move is explicitly resolved by the founder-approved maintainer decision above.