Skip to content

fix(k8s): show deployment help without cluster access - #198914

Merged
roboclaw-bot merged 1 commit into
openclaw:mainfrom
llbohacll:fix/k8s-help-offline
Nov 16, 2026
Merged

roboclaw-bot merged 1 commit into
openclaw:mainfrom
llbohacll:fix/k8s-help-offline

Conversation

@llbohacll

@llbohacll llbohacll commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #198913

What Problem This Solves

Fixes Kubernetes deployment help failing before it prints usage when deployment tools or cluster access are unavailable.

User Impact

Operators can read --help and -h before installing tools, configuring kubeconfig, or restoring cluster connectivity.

Why This Change Was Made

The existing help branch now runs before the deployment preflight. Operational modes still require the same tools and a reachable cluster.

Evidence

  • Both help regressions fail on the base and pass with this change. All six tests in test/scripts/k8s-deploy.test.ts pass, including the existing teardown cases and an unreachable-cluster deletion control.
  • Full-script checks with a temporary, restricted PATH reproduce missing-tool and unreachable-cluster failures on the base. Both help flags now exit 0 with usage and no tool calls. --delete still exits 1 in both environments. Kubernetes calls were inert stubs; no live cluster was used.
  • Focused lint, the root scripts test typecheck, formatting and /bin/bash -n scripts/k8s/deploy.sh pass.

Validated on macOS 27.0.1, system Bash 3.2.57 and Node 26.12.1. The six-test wrapper completed in 2.30 seconds.

Validation commands
node scripts/test-projects.mts test/scripts/k8s-deploy.test.ts
node scripts/run-oxlint.mjs --tsconfig test/tsconfig/tsconfig.test.root.json test/scripts/k8s-deploy.test.ts
node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.root.scripts.json --incremental
pnpm exec oxfmt --check test/scripts/k8s-deploy.test.ts
/bin/bash -n scripts/k8s/deploy.sh

Full-script terminal capture

The following output comes from /bin/bash scripts/k8s/deploy.sh itself. For the missing-tools case, the temporary PATH contains only dirname and cat; kubectl and openssl do not exist on that PATH. For the unavailable-cluster case, both are inert executables that record calls and exit 1. Each process receives only that PATH and the temporary call-log path.

BASE
missing-tools        --help   exit=1 usage=false tool_calls=0 stderr=Missing: kubectl
missing-tools        -h       exit=1 usage=false tool_calls=0 stderr=Missing: kubectl
missing-tools        --delete exit=1 usage=false tool_calls=0 stderr=Missing: kubectl
unreachable-cluster  --help   exit=1 usage=false tool_calls=1 stderr=Cannot connect to cluster. Check kubeconfig.
unreachable-cluster  -h       exit=1 usage=false tool_calls=1 stderr=Cannot connect to cluster. Check kubeconfig.
unreachable-cluster  --delete exit=1 usage=false tool_calls=1 stderr=Cannot connect to cluster. Check kubeconfig.

FIXED
missing-tools        --help   exit=0 usage=true tool_calls=0
missing-tools        -h       exit=0 usage=true tool_calls=0
missing-tools        --delete exit=1 usage=false tool_calls=0 stderr=Missing: kubectl
unreachable-cluster  --help   exit=0 usage=true tool_calls=0
unreachable-cluster  -h       exit=0 usage=true tool_calls=0
unreachable-cluster  --delete exit=1 usage=false tool_calls=1 stderr=Cannot connect to cluster. Check kubeconfig.

Actual stdout for both fixed help flags in both environments:

Usage: ./scripts/k8s/deploy.sh [OPTION]

  (no args)        Deploy OpenClaw (creates secret from env if needed)
  --create-secret  Create or update the K8s Secret from env vars without deploying
  --show-token     Print the gateway token after deploy or secret creation
  --delete         Delete the default namespace, or resources only in a custom namespace
  --delete-resources
                  Delete OpenClaw resources from the namespace
  --delete-namespace
                  Delete the namespace and all resources in it
  -h, --help       Show this help

Environment:
  Export at least one provider API key:
    ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY

  OPENCLAW_NAMESPACE     Kubernetes namespace (default: openclaw)

The deletion controls still stop at preflight. No cluster operation is simulated as successful, and no live cluster is accessed. The base/head comparison changes only the deployment script between b27440329b4c and 8869e1987715; the fixture and invocation remain identical.

@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Nov 14, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 14, 2026
@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Moves Kubernetes deployment preflight checks after help handling so both help flags work offline.

Example: Run /bin/bash scripts/k8s/deploy.sh --help without kubectl installed.

  • Before: Exits 1 with Missing: kubectl and no usage.
  • After: Prints usage and exits 0 without invoking deployment tools.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused, correct bug fix with shipped-script before/after evidence and meaningful regression controls; workflow approval remains separate from patch quality.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The added terminal capture resolves the previous review's sole rank-up request: the complete deployment script on macOS Bash 3.2 prints usage and exits 0 for both help flags with tools absent or the cluster probe failing, while deletion still fails preflight; inert tool executables are appropriate because successful help must never invoke them.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Kubernetes operators cannot read deployment usage until deployment tools and cluster access work.
Reason: Restores ordinary help behavior without adding options, changing defaults, or altering deployment and teardown semantics.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR fixes a current-main help failure with a focused change and no introduced defects found; CI awaits workflow approval.

Priority: P2
Reviewed head: 8869e198771586cc800fc4a24cb38430a00d56d1

Before merge

  • Await maintainer action - Approve the GitHub Actions runs awaiting approval for commit 8869e19, including CI run 43605802000.

Findings

None.

Agent review details

How this fits together

The Kubernetes deployment script accepts operator flags and environment settings, prints local help, or validates tooling and cluster connectivity before managing OpenClaw resources.

flowchart TD
  A[Operator invocation] --> B[Deployment script]
  B --> C[Help handling]
  C --> D[Usage and successful exit]
  B --> E[Tool and cluster preflight]
  E --> F[Deployment or teardown]
Loading

Technical review

Best possible solution:

Keep the existing help branch before deployment preflight and retain all operational checks.

Do we have a high-confidence way to reproduce the issue?

Current-main source deterministically exits during preflight before help when tools or cluster connectivity are absent; contributor terminal output confirms both cases, and this read-only review executed no target code.

Is this the best way to solve the issue?

This is the smallest complete fix: preserve the invariant that help requires no deployment access by moving the unchanged preflight below its existing early exit, using the existing script and test owners.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e741fd0d21ff.

Provenance checked

  • Deployment preflight and help ordering changes intended behavior with a stated reason (8e0e4f7: The original merged Kubernetes starter added deployment prerequisites and usage together; no recorded contract requires cluster access merely to display help.)
  • Existing teardown regression fixture keeps the original intent (0bc32f0: Protect scoped custom-namespace teardown and explicit whole-namespace deletion; later test consolidation retained these contracts.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • JackS1237: Raw commit 0bc32f0 adds scripts/k8s/deploy.sh:87 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0bc32f0f5cf5; files: scripts/k8s/deploy.sh)
  • Peter Steinberger: Raw commit f8a3418 adds scripts/k8s/deploy.sh:61 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f8a3418494f0; files: scripts/k8s/deploy.sh)

PR surface

Tests +22, Other 0. Total +22 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 25 3 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 5 5 0
Total 2 30 8 +22

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Root-cause cluster

Relationship: same_root_cause
Canonical: #198913
Summary: This PR directly addresses the linked report's preflight-before-help ordering.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Offline help is broken for Kubernetes operators, with limited impact on an advanced deployment workflow.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-14T14:52:01.239Z sha 8869e19 :: needs real behavior proof before merge. :: none

Reviewed November 14, 2026, 10:03 AM ET / 15:03 UTC (Revision 2).

@llbohacll

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added the requested terminal capture to the PR body: the complete deployment script shows usage for both flags with deployment tools absent and with a failing cluster probe. Captured exit codes, tool-call counts and unchanged deletion preflight controls are included. No code change.

@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 14, 2026
@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Nov 15, 2026
@sallyom sallyom self-assigned this Nov 15, 2026
@roboclaw-bot
roboclaw-bot merged commit b83aae1 into openclaw:main Nov 16, 2026
134 of 138 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
Allow Kubernetes deployment help to print before deployment tools or cluster access are available, while preserving preflight checks for all operational modes.

Validated the exact script in 18 isolated base/head scenarios, including both help flags, absent tools, unreachable-cluster controls, and all three teardown modes.

CI exception: check-test-types in run 43605802000, attempt 2, fails on TS18048 in scripts/perf/state-read-worker-bench.ts:373. The tested baseline and merge have identical benchmark inputs; main already contains the repair from openclaw#198912. No passing CI conclusion is claimed for that failed attempt. Security and review gates remain required.

Closes openclaw#198913.

Co-authored-by: Leonardo Bohac <[email protected]>
Co-authored-by: sallyom <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawtributors PR from a clawtributor P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: XS status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Kubernetes deployment help fails without a configured cluster

3 participants