Skip to content

NETOBSERV-3036: Rewrite plugin in Golang and reorganize collector packages - #605

Open
jpinsonneau wants to merge 10 commits into
netobserv:mainfrom
jpinsonneau:refactor/go-cli-collector
Open

jpinsonneau wants to merge 10 commits into
netobserv:mainfrom
jpinsonneau:refactor/go-cli-collector

Conversation

@jpinsonneau

@jpinsonneau jpinsonneau commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Rewrite the CLI from Bash to Go and reorganize the collector while consuming the shared capture package from the operator repository.

Review commits in order:

  • Split the collector into focused display, flow, packet, metrics, formatting, lifecycle, and transport packages.
  • Replaced the shell plugin with a Go/Cobra implementation using typed Kubernetes resources and generated Go manifests.
  • Added collector TUI, PTY, smoke, and E2E coverage.
  • Updated build tooling, multi-architecture packaging, documentation, and examples.
  • Hardened capture lifecycle behavior, including pcap flushing, TLS setup, cleanup progress, and CLI RBAC.
  • Integrated the shared capture, pipeline, TLS, dashboard, monitoring, and filter code from the operator repository.

Dependency

This PR consumes the shared public package introduced by netobserv-operator#2993. The operator PR should merge first; the CLI module currently points to its pinned commit until that package is released.

Validation

  • Vendored unit tests
  • Lint and collector/plugin builds
  • Smoke and Kind E2E tests
  • Manual OpenShift 4.22 validation for flows, packets, metrics, filters, TLS, and FlowCapture interoperability

@jpinsonneau
jpinsonneau force-pushed the refactor/go-cli-collector branch from d4b194a to 2019279 Compare October 14, 2026 15:25
@jpinsonneau jpinsonneau changed the title Rewrite CLI in Go and reorganize collector packages Rewrite plugin in Golang and reorganize collector packages Oct 14, 2026
@jpinsonneau jpinsonneau changed the title Rewrite plugin in Golang and reorganize collector packages NETOBSERV-3036: Rewrite plugin in Golang and reorganize collector packages Oct 14, 2026
@openshift-ci-robot

openshift-ci-robot commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

@jpinsonneau: This pull request references NETOBSERV-3036 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.1.0" version, but no target version was set.

Details

In response to this:

Summary

Rewrite the CLI from Bash/YAML generation to Go, with a focused package layout for the collector and plugin.

Review guide

  • refactor: split collector into focused Go packages

  • Moves collector startup and runtime code under internal/collector.

  • Separates display, flow, packet, metrics, format, lifecycle, transport, and test helpers.

  • Adds shared Kubernetes client, OpenShift, TLS, and Kind configuration packages.

  • refactor: replace shell plugin with Go implementation

  • Replaces the shell/oc exec workflow with a Go client plugin.

  • Builds typed manifests and agent configuration in Go.

  • Adds capture lifecycle, waiting, logs, copy/progress, cleanup, filters, and subnet handling.

  • Removes obsolete shell scripts and legacy resources.

  • build: update tooling, docs, and release packaging

  • Separates collector and plugin build targets while preserving compatibility targets.

  • Adds multi-architecture Krew plugin packaging.

  • Moves devtools to Go and updates E2E setup, documentation, and examples.

Validation

  • Unit tests, lint, vet, collector/plugin builds, smoke tests, and E2E tests pass.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@jpinsonneau
jpinsonneau force-pushed the refactor/go-cli-collector branch 3 times, most recently from b0b652c to 8649969 Compare October 15, 2026 15:59
@github-actions

Copy link
Copy Markdown

New image:

quay.io/netobserv/network-observability-cli:86499694

It will expire in two weeks.

To use this build, update your commands using:

USER=netobserv VERSION=86499694 make commands

or download the updated commands.

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 47.75174% with 2475 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.78%. Comparing base (39d3f1d) to head (8649969).

Files with missing lines Patch % Lines
internal/collector/format/table_protocol.go 3.93% 317 Missing ⚠️
internal/plugin/commands/run.go 0.00% 212 Missing ⚠️
internal/plugin/capture/exec.go 0.00% 106 Missing ⚠️
internal/collector/metrics_screen.go 35.00% 98 Missing and 6 partials ⚠️
internal/plugin/commands/helpers.go 11.92% 96 Missing ⚠️
internal/collector/flow_table.go 39.31% 82 Missing and 6 partials ⚠️
internal/collector/capture_packet.go 34.21% 67 Missing and 8 partials ⚠️
internal/collector/flow_screen.go 53.37% 58 Missing and 11 partials ⚠️
internal/plugin/commands/packets.go 29.88% 61 Missing ⚠️
cmd/devtools/gendocs/main.go 0.00% 60 Missing ⚠️
... and 71 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #605       +/-   ##
===========================================
+ Coverage   35.05%   46.78%   +11.72%     
===========================================
  Files          29       93       +64     
  Lines        4082     5966     +1884     
===========================================
+ Hits         1431     2791     +1360     
- Misses       2498     2892      +394     
- Partials      153      283      +130     
Flag Coverage Δ
unittests 46.78% <47.75%> (+11.72%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/collector/commands.go 75.00% <100.00%> (ø)
internal/collector/display/options.go 100.00% <100.00%> (ø)
internal/collector/format/plaintext_decode.go 57.04% <100.00%> (ø)
internal/collector/packet/plaintext.go 83.07% <100.00%> (ø)
internal/collector/transport/tls.go 90.00% <100.00%> (ø)
internal/k8s/tls/config.go 85.00% <ø> (ø)
internal/k8s/tls/resolve.go 43.85% <ø> (ø)
internal/plugin/manifests/configmap.go 100.00% <100.00%> (ø)
internal/plugin/manifests/namespace.go 100.00% <ø> (ø)
internal/plugin/manifests/pipeline.go 50.00% <ø> (ø)
... and 83 more

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Julien Pinsonneau <jpinsonn@redhat.com>
Signed-off-by: Julien Pinsonneau <jpinsonn@redhat.com>
Signed-off-by: Julien Pinsonneau <jpinsonn@redhat.com>
Signed-off-by: Julien Pinsonneau <jpinsonn@redhat.com>
Signed-off-by: Julien Pinsonneau <jpinsonn@redhat.com>
Signed-off-by: Julien Pinsonneau <jpinsonn@redhat.com>
Signed-off-by: Julien Pinsonneau <jpinsonn@redhat.com>
@jpinsonneau
jpinsonneau force-pushed the refactor/go-cli-collector branch from 9219616 to a8e8f46 Compare October 23, 2026 14:49
Signed-off-by: Julien Pinsonneau <jpinsonn@redhat.com>
@jpinsonneau jpinsonneau changed the title NETOBSERV-3036: Rewrite plugin in Golang and reorganize collector packages refactor: rewrite CLI and split collector packages Oct 23, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Collaborator

@jpinsonneau: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

Details

In response to this:

Summary

Rewrite the CLI from Bash to Go and reorganize the collector while consuming the shared capture package from the operator repository.

Review commits in order:

  • Split the collector into focused display, flow, packet, metrics, formatting, lifecycle, and transport packages.
  • Replaced the shell plugin with a Go/Cobra implementation using typed Kubernetes resources and generated Go manifests.
  • Added collector TUI, PTY, smoke, and E2E coverage.
  • Updated build tooling, multi-architecture packaging, documentation, and examples.
  • Hardened capture lifecycle behavior, including pcap flushing, TLS setup, cleanup progress, and CLI RBAC.
  • Integrated the shared capture, pipeline, TLS, dashboard, monitoring, and filter code from the operator repository.

Dependency

This PR consumes the shared public package introduced by netobserv-operator#2993. The operator PR should merge first; the CLI module currently points to its pinned commit until that package is released.

Validation

  • Vendored unit tests
  • Lint and collector/plugin builds
  • Smoke and Kind E2E tests
  • Manual OpenShift 4.22 validation for flows, packets, metrics, filters, TLS, and FlowCapture interoperability

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@jpinsonneau jpinsonneau changed the title refactor: rewrite CLI and split collector packages NETOBSERV-3036: Rewrite plugin in Golang and reorganize collector packages Oct 23, 2026
@openshift-ci-robot

openshift-ci-robot commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

@jpinsonneau: This pull request references NETOBSERV-3036 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.1.0" version, but no target version was set.

Details

In response to this:

Summary

Rewrite the CLI from Bash to Go and reorganize the collector while consuming the shared capture package from the operator repository.

Review commits in order:

  • Split the collector into focused display, flow, packet, metrics, formatting, lifecycle, and transport packages.
  • Replaced the shell plugin with a Go/Cobra implementation using typed Kubernetes resources and generated Go manifests.
  • Added collector TUI, PTY, smoke, and E2E coverage.
  • Updated build tooling, multi-architecture packaging, documentation, and examples.
  • Hardened capture lifecycle behavior, including pcap flushing, TLS setup, cleanup progress, and CLI RBAC.
  • Integrated the shared capture, pipeline, TLS, dashboard, monitoring, and filter code from the operator repository.

Dependency

This PR consumes the shared public package introduced by netobserv-operator#2993. The operator PR should merge first; the CLI module currently points to its pinned commit until that package is released.

Validation

  • Vendored unit tests
  • Lint and collector/plugin builds
  • Smoke and Kind E2E tests
  • Manual OpenShift 4.22 validation for flows, packets, metrics, filters, TLS, and FlowCapture interoperability

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Signed-off-by: Julien Pinsonneau <jpinsonn@redhat.com>
@openshift-ci

openshift-ci Bot commented Oct 23, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jotak for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Julien Pinsonneau <jpinsonn@redhat.com>
@openshift-ci

openshift-ci Bot commented Oct 23, 2026

Copy link
Copy Markdown

@jpinsonneau: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration-tests da7b2b6 link true /test integration-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants