github vladimirvivien/ktop v0.7.6

56 minutes ago

ktop Release v0.7.6

ktop v0.7.6 introduces a dedicated [3] Events tab for live, cluster- and namespace-wide Kubernetes Event monitoring, adds a floating Event Detail modal with full untruncated messages and cross-tab object inspection, exposes normalized events in --noui JSON/JSONL snapshots, and refines top-level tab navigation with < / > shortcuts.

Operators can switch directly to [3] Events (via key 3, < / >, --page=events, or ui.default_page: events), filter down to Warnings (w), pause live updates during event storms (f) while tracking incoming event deltas, open any event in a floating modal to read full word-wrapped messages, inspect raw Event YAML (v), or jump directly to the involved Pod, Node, Deployment, StatefulSet, DaemonSet, or Job (g).


Detailed Changes by Category

1. Standalone [3] Events Page & Floating Event Detail Modal (views/events, application, ui, config, cmd)

Cluster-Wide Chronological Event Stream

  • Problem / Context: Events were previously visible only inside single-object detail views (Node Detail, Pod Detail, and Workload Detail), providing no cluster- or namespace-wide feed for cross-resource warnings such as scheduling failures, image pull errors, mount failures, or eviction cascades.
  • Technical Implementation: Added the views/events package (views/events/page.go, views/events/summary.go, views/events/detail_modal.go) and registered [3] Events (application.PageEvents) in application/tui/app.go. Added "events" to config.ValidPages (config/config.go) and updated --page in cmd/ktop.go. Added ui.EventsContext and ui.EventDetailModalContext in ui/footer_context.go.
  • Behavioral Notes:
    • Single-line Summary bar displays Events, Warnings, Normal, top firing Reason (prioritizing Warning reasons when present), and active stream badges (ALL | WARNINGS ONLY, LIVE | PAUSED (+N new)).
    • Table columns: LAST SEEN | TYPE | REASON | OBJECT | NS | COUNT | MESSAGE using ui.TableController for column sorting, / substring filtering, and y clipboard copy.
    • Key w toggles Warnings-only filtering; key f freezes/resumes live table updates while tracking new event arrivals in the summary bar. Both keys are suppressed while editing / filter input.
    • Syncs automatically with the global namespace filter shared across Overview and Workloads.

Floating Event Detail Modal & Cross-Tab Object Jump

  • Problem / Context: Single-line event table rows truncate long Kubernetes event messages and require manual navigation to inspect the affected workload, pod, or node.
  • Technical Implementation: Implemented events.DetailModal (views/events/detail_modal.go) on ui.OverlayFrame, showing normalized metadata (Type, Reason, Object, Count, First Seen, Last Seen, Source, Event Name) above a scrollable, word-wrapped full message view. Added Application.JumpToObject(kind, namespace, name) and application.IsInspectableObjectKind(kind) in application/app_ctrl.go.
  • Behavioral Notes:
    • Pressing Enter on an event opens the floating Event Detail modal (ESC / q closes and restores table focus; y copies the full message; v opens raw Event YAML via k8s.FormatObjectYAML).
    • Pressing g jumps to the involved resource when inspectable: Pod opens the shared floating Pod Inspector modal over [3] Events, Node switches to [1] Overview and opens Node Detail, and Deployment/StatefulSet/DaemonSet/Job switches to [2] Workloads and opens Workload Detail. Missing or already-deleted objects display a warning toast instead of opening an empty view.

2. Normalized Event Model, Informer Controller & --noui Snapshot (views/model, k8s, internal/snapshot, collector)

Unified core/v1 and events.k8s.io/v1 Event Normalization

  • Problem / Context: Controllers emitting events.k8s.io/v1 events populate Series.LastObservedTime, Series.Count, EventTime, and ReportingController rather than legacy LastTimestamp, Count, and Source.Component, causing incomplete counts or misordered timelines.
  • Technical Implementation: Added views/model/event_model.go (EventModel, EventsSummary, EventsSnapshot, NewEventModel, EventLastTimestamp, EventFirstTimestamp, EventCount, EventSource, ComputeEventsSummary, SortEventModelsBy). Added k8s/events_controller.go (SetEventsRefreshFunc, GetEventsSnapshot, HasObject) backed by the existing shared coreInformers.Events() informer with no additional API watch or RBAC requirement. Updated sortEventsByTime in k8s/client_funcs.go to use model.EventLastTimestamp.
  • APIs / Signatures:
    snap, err := ctrl.GetEventsSnapshot(ctx, k8s.AllNamespaces, k8s.DefaultTUIEventsLimit)
    exists := ctrl.HasObject("Pod", "default", "api-0")

events Field in internal/snapshot and Headless --noui Output

  • Problem / Context: Headless --noui JSON/JSONL reports previously omitted cluster event summaries and recent event records.
  • Technical Implementation: Added EventsData, EventsSummaryData, and EventData (json:"events,omitempty") to snapshot.Snapshot with deep-copy support in Snapshot.Clone() (internal/snapshot/snapshot.go) and conversion helpers (eventsDataFromModel, ToEventsSnapshot) in internal/snapshot/builder.go. Populated BuildInput.Events in collector/k8s_provider.go (bounded by k8s.DefaultSnapshotEventsLimit) and propagated Events onto collector.Aggregate (collector/collector.go).
  • APIs / Signatures:
    {
      "events": {
        "summary": {
          "total": 12,
          "warning_count": 2,
          "normal_count": 10,
          "top_reason": "BackOff",
          "top_reason_count": 2
        },
        "items": []
      }
    }

3. Tab Navigation & Help Overlay Refinement (application, ui, docs)

< / > Page Navigation & Clearer Help Labels

  • Problem / Context: Square-bracket page navigation ([ / ]) rendered ambiguously in the keyboard shortcuts help overlay (1-3 / [ / ]).
  • Technical Implementation: Replaced [ / ] global page-switching bindings with < (PrevPage) and > (NextPage) in application/app_ctrl.go. Updated ui/help_modal.go to display separate Keys 1-3 and < or > lines, escaped key labels via tview.Escape, and updated docs/guide.md, docs/cli.md, and docs/noui.md.

Upgrade & Compatibility Notes

  • Backward Compatibility: Fully backward compatible with existing ktop CLI flags, kubectl ktop plugin usage, ~/.ktop/config.yaml configurations, and --noui JSON/JSONL consumers (events is an additive omitempty field).
  • Behavioral Changes: Sequential previous/next tab navigation now uses < and > (Shift+, / Shift+.) instead of [ and ]. Direct numeric tab switching (1–3) is unchanged.
  • Migration Actions: None required.

Workspace / Repository Metrics

 29 files changed, 2368 insertions(+), 39 deletions(-)

Don't miss a new ktop release

NewReleases is sending notifications on new releases.