1
0
Fork 0
mirror of https://github.com/imjasonh/client-go2 synced 2026-07-08 09:05:38 +00:00
Commit graph

27 commits

Author SHA1 Message Date
Jason Hall
46ff633b0e
fix CI again
Signed-off-by: Jason Hall <jason@chainguard.dev>
2025-07-27 17:21:03 -04:00
Jason Hall
bf141053f3
chore: Add Dependabot configuration for Go and GitHub Actions
- Configure weekly updates for Go modules
- Configure weekly updates for GitHub Actions
- Group Kubernetes dependencies (k8s.io/*) together
- Set update schedule for Mondays at 10:00 UTC
- Add appropriate labels for dependency PRs

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 17:16:28 -04:00
Jason Hall
9eaff0dc42
simplify patch
Signed-off-by: Jason Hall <jason@chainguard.dev>
2025-07-27 17:14:13 -04:00
Jason Hall
e5071fc0cf
Add support for label and field selectors in informers
- Add InformOptions struct with ListOptions and ResyncPeriod fields
- Update all client methods to accept options parameters
- Add comprehensive examples in main.go demonstrating:
  - Label selector filtering (test=example)
  - Field selector filtering (status.phase=Running)
  - Custom resync periods
- Add tests for label and field selectors with mock query parameter support
- Fix nil pointer handling in all client methods
- Update mock transport to handle query parameters correctly

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 17:13:22 -04:00
Jason Hall
d2b0d467e5
fix CI
Signed-off-by: Jason Hall <jason@chainguard.dev>
2025-07-27 16:35:38 -04:00
Jason Hall
fb8305a316
Refactor to use rest.Client directly instead of dynamic client
This major refactoring eliminates the dependency on the dynamic client
and unstructured types, using rest.RESTClient directly for all operations.

Key changes:
- Replace dynamic.Interface with rest.RESTClient in client struct
- Remove all unstructured.Unstructured conversions
- Use direct JSON marshaling/unmarshaling for type conversions
- Update all CRUD methods (List, Get, Create, Update, Delete, Patch)
- Reimplement Inform to use cache.ListWatch with rest client
- Export Client type and update method signatures
- Add proper GroupVersion and APIPath configuration in NewClientGVR
- Update all tests to use mock HTTP transport instead of fake dynamic client
- Fix informer event handler to use new InformerHandler type
- Update example code to demonstrate new API

Benefits:
- More efficient: eliminates unnecessary type conversions
- Cleaner code: direct use of REST client
- Better performance: reduced JSON marshaling overhead
- Type safety maintained through generics

All unit tests and e2e tests pass against a real Kubernetes cluster.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 16:33:45 -04:00
Jason Hall
cf4e05003b
README
Signed-off-by: Jason Hall <jason@chainguard.dev>
2025-07-23 16:33:24 -04:00
Jason Hall
4b9bb6db4d
Add CLAUDE.md for repository guidance
Provides comprehensive guidance for Claude Code when working with this
repository, including build/test commands, architecture overview, and
important coding rules.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 16:00:41 -04:00
Jason Hall
9eaaec04da
Update build.yaml 2025-07-23 11:45:58 -04:00
Jason Hall
74aace1a2d
Update to use stable Go and add comprehensive CI/CD
- Replace gotip with stable Go in GitHub Actions
- Add automatic GVR inference for Kubernetes types
- Rename API: NewClient (inferred GVR) and NewClientGVR (explicit)
- Add comprehensive test coverage including e2e tests
- Update CI to include linting, unit tests, and e2e tests with kind
- Add .gitignore for common Go development files
- Update README with usage examples and features

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 11:41:20 -04:00
Jason Hall
d6bb3cc61c
Update client-go2 with enhanced functionality and modern dependencies
- Fix syntax error in Inform method (< to ,)
- Add missing CRUD operations: Update, Delete, and Patch methods
- Add comprehensive test coverage for all client operations
- Update Kubernetes dependencies from v0.21.1 to v0.31.11
- Update Go version requirement to 1.22.0
- Update README to remove outdated Go 1.18 beta references
- Improve error handling and logging

The client now provides full CRUD functionality with type-safe generic
operations for any Kubernetes resource type, significantly reducing
boilerplate compared to traditional client-go usage.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 09:39:08 -04:00
Jason Hall
dca6437adb
Create LICENSE 2022-09-21 15:00:38 -04:00
Jason Hall
384f6ed83f add fancy badge 2021-12-15 12:18:41 -05:00
Jason Hall
fbf85d4793 make event handler configuration the caller's responsibility, maybe they want to enqueue the event 2021-12-15 12:17:04 -05:00
Jason Hall
8736289eac update README 2021-12-15 12:09:18 -05:00
Jason Hall
da349520ce Merge branch 'main' of github.com:imjasonh/client-go2 2021-12-15 12:05:55 -05:00
Jason Hall
fa4eb4d0f2 Playing with generic informers 2021-12-15 12:05:35 -05:00
Jason Hall
72d7dbe5fd
Update README.md 2021-11-13 07:25:55 -05:00
Jason Hall
ec96ad4354 remove load bearing import; no longer load bearing 2021-11-01 15:58:40 -04:00
Jason Hall
a45c068905 fix config 2021-11-01 15:47:39 -04:00
Jason Hall
f7ba9f0ab2 add github action 2021-11-01 15:44:00 -04:00
Jason Hall
b7c0e36470 take runtime.Object instead of T any 2021-09-10 14:03:39 -04:00
Jason Hall
08c01c3a33 just take a GVR in NewClient 2021-09-10 13:56:24 -04:00
Jason Hall
5539a6fa1d add link 2021-09-09 16:19:39 -04:00
Jason Hall
59f526eccf trying to make the client simpler; doesn't work :( 2021-09-09 16:06:10 -04:00
Jason Hall
f6db51af0f impl get and create 2021-09-09 13:13:19 -04:00
Jason Hall
a09c449fd7 initial commit 2021-09-09 12:29:21 -04:00