Skip to content

Conversation

@Bezbran
Copy link
Contributor

@Bezbran Bezbran commented Jan 22, 2026

Replace inner logic for plural forms to use imported k8s-interface as shared package

Summary by CodeRabbit

  • Chores
    • Updated github.com/kubescape/k8s-interface dependency from v0.0.201 to v0.0.202.
    • Improved internal resource type handling consistency across sensor components.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Bezalel Brandwine <bez@softwine.net>
@Bezbran Bezbran requested a review from matthyx January 22, 2026 10:46
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

Updated github.com/kubescape/k8s-interface dependency from v0.0.201 to v0.0.202, and refactored sensor kind/plural resolution to use centralized hostsensor package constants instead of hardcoded strings across multiple sensor implementations.

Changes

Cohort / File(s) Summary
Dependency Update
go.mod
Bumped github.com/kubescape/k8s-interface from v0.0.201 to v0.0.202
Sensor Kind/Plural Refactoring
pkg/hostsensormanager/sensor_cloudprovider.go, sensor_cni.go, sensor_controlplane.go, sensor_kernelvars.go, sensor_kernelversion.go, sensor_kubelet.go, sensor_kubeproxy.go, sensor_network.go, sensor_osrelease.go, sensor_security.go
Added hostsensor package import and replaced hardcoded kind strings in GetKind() with string(hostsensor.<ResourceType>) and hardcoded plural strings in GetPluralKind() with hostsensor.MapResourceToPlural(hostsensor.<ResourceType>) calls. No API signature changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • matthyx

Poem

🐰 Constants dance where strings once stood,
From scattered hardcodes to unity good,
Each sensor now speaks the hostsensor way,
Kind and plural aligned to stay,
Cleaner code hops through the day! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'use k8s-interface' is vague and does not convey the specific purpose of the changes, which involve refactoring sensor code to use the k8s-interface package for kind/plural mappings. Consider a more descriptive title such as 'Refactor sensors to use k8s-interface for kind and plural mappings' to better communicate the main change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

@matthyx matthyx added the release Create release label Jan 22, 2026
@Bezbran Bezbran merged commit fc869ad into main Jan 25, 2026
27 checks passed
@Bezbran Bezbran deleted the use-k8s-interface-pkg branch January 25, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Create release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants