Skip to content

Add underlying resource actions and custom columns to workload view - #4410

Open
yxshee wants to merge 1 commit into
derailed:masterfrom
yxshee:feat/workload-actions-and-columns
Open

yxshee wants to merge 1 commit into
derailed:masterfrom
yxshee:feat/workload-actions-and-columns

Conversation

@yxshee

@yxshee yxshee commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Bring the workload view (:wk) closer to the underlying Deployment and StatefulSet views and enable views.yaml custom column settings:

  • Underlying resource actions (internal/view/workload.go):
    • Enter on a Deployment or StatefulSet now opens its pods via showPodsFromSelector (other kinds keep existing gotoResource navigation).
    • Added l / p (logs / previous logs), r (rollout restart, multi-select supported), s (scale, multi-select supported), i (set container images), Shift-F / f (port-forward / show port-forwards) for Deployments and StatefulSets, and z (ReplicaSets) for Deployments.
    • Dangerous keys (r, s, i, along with e, Ctrl-D) are omitted in read-only mode; unsupported kinds are no-ops.
  • Row coloring parity (internal/render/workload.go):
    • Deployments and StatefulSets use the same row coloring as their own views (not-ready uses ErrColor via DefaultColorer, and Deployments scaled to 0 use PendingColor), while other workload kinds preserve existing behavior.
    • Row kind lookup reads the row ID prefix first so coloring still works when KIND is hidden or reordered.
  • views.yaml custom columns (internal/render/workload.go, internal/dao/workload.go):
    • render.Workload.Header() now delegates to doHeader(defaultWKHeader) and Render() realizes custom ColumnSpecs (supporting column reordering, |H / |W flags, and JSONPath/JQ columns).
    • dao.Workload.List() preserves r.Object on render.WorkloadRes so JSONPath/JQ custom column specs resolve against the underlying object when includeObject is enabled.
  • Tests:
    • Added unit tests in internal/render/workload_test.go and internal/view/workload_int_test.go.

Fixes #4401

This branch has not been deployed

No deployments
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.

Workload view: support the actions of the underlying resource views (Enter → pods, logs, restart) and custom columns

1 participant