• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 19312047856

12 Nov 2025 09:12PM UTC coverage: 49.006% (+0.09%) from 48.921%
19312047856

push

github

web-flow
Consolidate Kubernetes client utilities into pkg/k8s (#2560)

Consolidate Kubernetes client utilities

Move Kubernetes client creation and configuration utilities from
pkg/container/kubernetes to a new common package pkg/k8s. This
enables other packages to reuse these utilities without creating
circular dependencies.

Changes:
- Created pkg/k8s package with config, namespace, and client utilities
- Added three client creation functions for different use cases:
  * NewClient() for standard Kubernetes clientset
  * NewControllerRuntimeClient() for CRD-aware controller-runtime clients
  * NewDynamicClient() for dynamic/unstructured resource access
- Migrated pkg/container/kubernetes, pkg/groups, and operator to use pkg/k8s
- Removed duplicate namespace detection code
- Separated I/O operations from pure logic for better testability
- Added comprehensive test coverage with parallel-safe tests

Benefits:
- Single source of truth for Kubernetes client operations
- Eliminates code duplication across packages
- Better architecture with proper separation of concerns
- Improved testability with 100% test coverage of logic functions
- No circular dependencies between packages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>

75 of 160 new or added lines in 7 files covered. (46.88%)

1 existing line in 1 file now uncovered.

24239 of 49461 relevant lines covered (49.01%)

35.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/cmd/thv-operator/pkg/controllerutil/platform.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc