1
0
Fork 0
mirror of https://github.com/imjasonh/client-go2 synced 2026-07-08 00:55:56 +00:00
client-go2/generic
Jason Hall e79b66caf5
Add expansion methods and missing client-go operations
This PR adds support for resource-specific expansion methods and implements
missing standard client-go operations to achieve feature parity.

## New Features

### Expansion Methods
- Added PodClient with methods: GetLogs, Bind, Evict, ProxyGet
- Added ServiceClient with method: ProxyGet
- Both clients implement the official k8s.io/client-go expansion interfaces
- Runtime type assertions ensure type safety (panic if wrong type)

### Missing Standard Methods
- Watch: Watch resources with optional label/field selectors
- DeleteCollection: Delete multiple resources matching criteria
- UpdateStatus: Update only the status subresource

### Other Improvements
- Refactored all tests to use inline configuration pattern
- Added comprehensive e2e tests for new functionality
- Updated documentation with examples
- Fixed linting error in stream.Close() handling

## Design Decisions

The expansion methods follow a namespace-scoped pattern where calling
`client.PodClient("namespace")` returns a client that implements the
standard client-go PodExpansion interface. This maintains full API
compatibility while providing type safety through runtime assertions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 10:32:34 -04:00
..
client.go Add expansion methods and missing client-go operations 2025-07-28 10:32:34 -04:00
client_test.go Add expansion methods and missing client-go operations 2025-07-28 10:32:34 -04:00
e2e_test.go Add expansion methods and missing client-go operations 2025-07-28 10:32:34 -04:00
expansions.go Add expansion methods and missing client-go operations 2025-07-28 10:32:34 -04:00
expansions_test.go Add expansion methods and missing client-go operations 2025-07-28 10:32:34 -04:00