Skip to content

feat: render named kuke get <kind> <name> as a single table row - #1331

Merged
eminwux merged 1 commit into
mainfrom
feat/named-get-single-row
Jun 17, 2026
Merged

feat: render named kuke get <kind> <name> as a single table row#1331
eminwux merged 1 commit into
mainfrom
feat/named-get-single-row

Conversation

@eminwux

@eminwux eminwux commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Flips the default rendering of a named kuke get <kind> <name> from the full resource document to a single table row (same columns as the list view, filtered to one element) across all 10 kinds β€” completing the kubectl-parity story epic planning: kuke get β€” output revamp, selector, image as first-class kindΒ #601 started. The full document stays reachable via -o yaml / -o json, and -o wide renders the single wide row where the kind defines wide columns.
  • Mechanically, each subcommand's singular printer now routes yaml/json to the document printer and table/wide to the existing list renderer with a one-element slice. Seven kinds (realm, space, stack, blueprint, config, secret, volume) feed the list renderer's format-driven path; the three wide bool-plumbed kinds (cell, container, image) thread the wide flag through. Each -o help string updated from yaml for single resource β†’ table for single resource.
  • Per the invocation argument ("update cli dox for use case also"), this PR also lands the docs the issue body had deferred to a separate documentation follow-up: docs/cli-use-cases.md and docs/site/cli/kuke-get.md. Gate-vs-flip note for the reviewer: the docs were bundled here because the user explicitly requested it in this session; the issue body's "separate follow-up" remains the default if you'd prefer to split.

Notes on non-obvious calls

  • Not-found handling, scope-flag requirements, and selector/name mutual-exclusion are untouched β€” only the rendering of a found element changes.
  • container's named branch builds the single-element []ContainerSpec + containerProbe map the list renderer expects, backfilling scope coordinates the daemon may leave unset (mirrors the list path's defensive backfill).
  • image's named branch wraps res.Image in a one-element ListImagesResult{Realm, Images} for the list renderer.

Test plan

  • make test (full CI suite, test-root + test-kukebuild) β€” exit 0, no failures
  • go vet ./cmd/kuke/get/... β€” clean
  • gofmt -l cmd/kuke/get/ β€” clean
  • Per-kind named-get tests added covering the single-row path (table + wide where applicable) and the preserved -o yaml / -o json document path for all 10 kinds (realm, space, stack, blueprint, config, secret, volume, cell, container, image)
  • Updated the image package's prior …YAMLDefault test to the new contract (default β†’ table row; document via -o yaml)

Closes #1323

@eminwux eminwux added ready-for-review PR is handed off to the reviewer agent in-review Reviewer agent is actively reading this PR and removed ready-for-review PR is handed off to the reviewer agent labels Jun 16, 2026
@eminwux

eminwux commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

PR #1331 Review β€” feat: render named kuke get <kind> <name> as a single table row

Clean, consistent kubectl-parity flip across all 10 kinds β€” yaml/json route to the document printer, table/wide reuse the existing list renderer with a one-element slice. I verified the two trickier call sites (container, image) where the branch moved to the call site: arg order matches the printContainersWithState / printImages signatures, and wide + scope vars are all in scope. All commits signed, CI green, every test-plan box ticked, breaking UX change documented in both cli-use-cases.md and kuke-get.md. No security surface.

One non-blocking nit:

  • Dead case cmd/kuke/get/image/image.go:~545: printImage's case OutputFormatTable branch is now unreachable β€” the named path only routes yaml/json to printImage. Private and harmless (it maps to PrintYAML like the default anyway); collapse into the default if touching this again.

LGTM β€” ship it; the nit is non-blocking.

@eminwux eminwux added ready-to-merge Reviewed and ready to merge and removed in-review Reviewer agent is actively reading this PR labels Jun 16, 2026
@eminwux

eminwux commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

PR #1331 Review (second reviewer) β€” feat: render named kuke get <kind> <name> as a single table row

Concur with the first reviewer β€” LGTM, no blocking items. Verified independently: the three wide-bool kinds (cell/container/image) call their list renderers with signatures identical to the list paths, and the seven format-driven kinds pass OutputFormatWide straight through (printRealms & co. honor it via wide := format == OutputFormatWide), so -o wide parity holds across all 10. Container scope-backfill mirrors the list path, all guards (MetadataExists/ContainerExists) precede the print, no nil-deref. Cross-PR check clean (merge-base == baseRefOid, no sibling touched these files), commit signature valid. The breaking UX flip (named get β†’ table by default) is documented with -o yaml migration guidance in both the PR body and the two docs files. Leaving ready-to-merge as-is.

@eminwux
eminwux merged commit b22ebf6 into main Jun 17, 2026
5 checks passed
@eminwux
eminwux deleted the feat/named-get-single-row branch June 17, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Reviewed and ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: kuke get <kind> <name> should render a single table row, not the full document

1 participant