Skip to content

Remove kskubemanager dependency and replace with kubemanager in tracer_factory#729

Merged
matthyx merged 1 commit intomainfrom
remove-ksmanager
Feb 27, 2026
Merged

Remove kskubemanager dependency and replace with kubemanager in tracer_factory#729
matthyx merged 1 commit intomainfrom
remove-ksmanager

Conversation

@matthyx
Copy link
Contributor

@matthyx matthyx commented Feb 26, 2026

Summary by CodeRabbit

  • Chores
    • Updated Kubernetes manager implementation to use an alternative codebase.
    • Updated inspektor-gadget dependency version.

…r_factory

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

The PR updates the Kubernetes manager dependency to a newer commit version and removes the legacy KsKubeManager implementation, migrating the tracer factory to use a new kubemanager package for Kubernetes management.

Changes

Cohort / File(s) Summary
Dependency Update
go.mod
Updated the replace directive for inspektor-gadget to a newer commit (v0.0.0-20260226175242-c524fbad47d9).
Migration to New KubeManager
pkg/containerwatcher/v2/tracers/tracer_factory.go
Changed import from kskubemanager to kubemanager and updated initialization from NewKsKubeManager() to NewKubeManager().
Legacy Code Removal
pkg/kskubemanager/kubemanager.go
Removed entire file containing the deprecated KsKubeManager type, KubeManagerInstance type, and all associated lifecycle, initialization, and event handling methods.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Out with the old KsKubeManager's maze,
In with the new in brighter ways,
Tracers now follow a cleaner path,
No legacy chains hold back our wrath,
A hoppy refactor, fresh and free! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: removing the kskubemanager dependency and replacing it with kubemanager in the tracer_factory file.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-ksmanager

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
go.mod (1)

461-461: Document a long-term strategy for this fork dependency.

The fork carries custom implementations (e.g., NewKubeManager() constructor and externalCollections bypass pattern) that are not present in upstream inspektor-gadget (including latest releases v0.49.0 and v0.49.1). Since equivalent changes are not merged upstream, maintain clear documentation on whether these changes should be upstreamed, consolidated into the fork long-term, or addressed through an alternative approach to reduce ongoing maintenance burden.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go.mod` at line 461, Document the long-term strategy for the forked
dependency replacement (the replace directive pointing to
matthyx/inspektor-gadget) by adding a short design note describing whether the
custom changes (notably the NewKubeManager() constructor and the
externalCollections bypass pattern) will be upstreamed, maintained in the fork,
or replaced with alternatives; include a summary of all diffs from upstream, a
migration/maintenance plan (how to reconcile upstream releases and when to
sync), and an owner/decision point for future changes so maintainers can follow
a clear process.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@go.mod`:
- Line 461: Document the long-term strategy for the forked dependency
replacement (the replace directive pointing to matthyx/inspektor-gadget) by
adding a short design note describing whether the custom changes (notably the
NewKubeManager() constructor and the externalCollections bypass pattern) will be
upstreamed, maintained in the fork, or replaced with alternatives; include a
summary of all diffs from upstream, a migration/maintenance plan (how to
reconcile upstream releases and when to sync), and an owner/decision point for
future changes so maintainers can follow a clear process.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ad58a8 and 9bbd3de.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • go.mod
  • pkg/containerwatcher/v2/tracers/tracer_factory.go
  • pkg/kskubemanager/kubemanager.go
💤 Files with no reviewable changes (1)
  • pkg/kskubemanager/kubemanager.go

@matthyx matthyx merged commit cc5fca4 into main Feb 27, 2026
27 checks passed
@matthyx matthyx deleted the remove-ksmanager branch February 27, 2026 08:47
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.

1 participant