Skip to content

feat(next)!: operator monitor command - #1528

Merged
eoghanriley merged 20 commits into
mainfrom
eoghanriley/cli-285
Sep 4, 2026
Merged

eoghanriley merged 20 commits into
mainfrom
eoghanriley/cli-285

Conversation

@eoghanriley

@eoghanriley eoghanriley commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Next implementation of uds monitor pepr

Related Issue

Fixes CLI-285

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@eoghanriley eoghanriley changed the title feat: operator monitor command feat(next)!: operator monitor command Aug 28, 2026
@eoghanriley
eoghanriley marked this pull request as ready for review September 2, 2026 17:49
@eoghanriley
eoghanriley requested a review from a team as a code owner September 2, 2026 17:49
@greptile-apps

greptile-apps Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR introduces uds core operator monitor for streaming and filtering UDS Core operator and Pepr policy activity.

  • Adds the Next-mode command hierarchy and monitoring options.
  • Discovers Pepr controller containers and streams their Kubernetes logs.
  • Formats operator, policy, mutation, and failure events as terminal text or JSON.
  • Adds unit and cluster-integration coverage, test workloads, and a command-placement ADR.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
internal/operator/monitor.go Implements target discovery, concurrent log streaming and reconnection, event filtering, and output processing; both previously reported lifecycle failures are addressed.
internal/cli/core/operator_monitor.go Defines the monitor command, validates arguments, and maps CLI flags into operator monitoring options.
internal/operator/formatter.go Adds structured text rendering for operator and policy events, including mutation patches and repeated-event counts.
internal/operator/monitor_test.go Covers stream selection, filtering, formatting, error handling, repeated events, and clean-EOF reconnection.
tests/cluster/operator_monitor_test.go Exercises the command against synthetic admission and watcher pods in a cluster integration environment.

Sequence Diagram

sequenceDiagram
    actor User
    participant CLI as uds core operator monitor
    participant K8s as Kubernetes API
    participant Pods as Pepr controller pods
    participant Processor as Log processor
    User->>CLI: Run monitor with filters
    CLI->>K8s: List pods in pepr-system
    K8s-->>CLI: Admission and watcher pods
    loop Selected containers
        CLI->>Pods: Open log stream
        Pods-->>Processor: Pepr log entries
        Processor-->>User: Filtered text or JSON events
        alt Follow stream ends
            CLI->>CLI: Wait before reconnect
            CLI->>Pods: Reopen log stream
        end
    end
Loading

Reviews (2): Last reviewed commit: "fix: greptile feedback" | Re-trigger Greptile

Comment thread internal/operator/monitor.go Resolved
Comment thread internal/operator/monitor.go Resolved
Comment thread internal/operator/monitor_test.go Resolved
Comment thread internal/operator/monitor.go Resolved
Comment thread internal/operator/monitor.go Resolved
Comment thread internal/operator/monitor.go Resolved
Comment thread internal/cli/core/operator_monitor.go Resolved
chance-coleman
chance-coleman previously approved these changes Sep 3, 2026

@chance-coleman chance-coleman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work, happy with this. I'd probably appreciate one more set of eyes on this.

@joelmccoy joelmccoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM - great job porting and removing bubblecharm dep. One comment for consideration, i would recommend marking this feature as alpha

Comment thread internal/cli/core/operator_monitor.go Resolved
@eoghanriley
eoghanriley merged commit 9b8a6b0 into main Sep 4, 2026
58 of 59 checks passed
@eoghanriley
eoghanriley deleted the eoghanriley/cli-285 branch September 4, 2026 17:57
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.

3 participants