Skip to content

feat: make demo mode opt-in and add a "No cluster" state - #2

Merged
pierreneter merged 1 commit into
mainfrom
feat/no-cluster-demo-context
Aug 31, 2026
Merged

pierreneter merged 1 commit into
mainfrom
feat/no-cluster-demo-context

Conversation

@pierreneter

Copy link
Copy Markdown
Member

What

Thanks @clamshell2000 for pointing out the confusion: with no cluster, k10s opened straight onto mock data — a laptop with no kubeconfig showed 3 nodes, 40 pods and a CrashLoopBackOff that existed nowhere, labelled only by a "mock mode" line in the status bar. So the demo is now its own thing.

Now:

  • Plain k10s → real cluster only. No cluster → No cluster panel.
  • Demo is opt-in and is a context, not a mode: k10s demo.

Changes

Demo as a context (domain.DemoContext = k10s-demo)

  • k10s demo / --demo → boots on demo context
  • /demo → switch from anywhere
  • :ctx always lists it, labelled k10s demo · sample data + legend
  • Leaving = pick any other context (no separate exit)
  • DEMO marker in header while active

No cluster state (internal/ui/nocluster.go)

  • Two failures collapse to "no cluster": kubeconfig won't load/name a context, or the API server doesn't answer (store.Ping() now gates it)
  • noClusterReason() trims client-go's multi-sentence errors to the useful first clause
  • Keys: r retry · :ctx pick another · /setup connect guide
  • Failing a context switch keeps the live cluster on screen — only a cold start with nothing behind it goes offline

Commands

  • +/setup, +/demo, :mouse → /mouse (k10s's own, not the cluster's)

Docs

  • New docs/cluster-setup.md (kubectl install + kubeconfig), linked from the panel, /setup, and usage text — one canonical URL constant
  • README, backends, keybindings, ui, roadmap updated; tapes/screenshot regenerated off k10s demo

Tests

internal/ui/demo_test.go (246), internal/ui/nocluster_test.go (193).


Reported by @clamshell2000.

@pierreneter
pierreneter merged commit 3afdedd into main Aug 31, 2026
@pierreneter
pierreneter deleted the feat/no-cluster-demo-context branch August 31, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant