1
0
Fork 0
mirror of https://github.com/imjasonh/client-go2 synced 2026-07-08 17:16:47 +00:00
client-go2/README.md
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

1.6 KiB

Experimenting with k8s.io/client-go and Go generics

Build

This is an experimental type-parameter-aware client that wraps k8s.io/client-go/dynamic (...for now).

Assuming you've got a working kubeconfig (does kubectl get pods work?), you can run this code:

$ go run ./
2021/12/15 12:08:11 LISTING PODS
2021/12/15 12:08:11 - coredns-558bd4d5db-hjs27
2021/12/15 12:08:11 - coredns-558bd4d5db-vhrtd
2021/12/15 12:08:11 - etcd-kind-control-plane
2021/12/15 12:08:11 - kindnet-c977m
2021/12/15 12:08:11 - kube-apiserver-kind-control-plane
2021/12/15 12:08:11 - kube-controller-manager-kind-control-plane
2021/12/15 12:08:11 - kube-proxy-fgpfd
2021/12/15 12:08:11 - kube-scheduler-kind-control-plane
I1215 12:08:11.086322   32526 shared_informer.go:240] Waiting for caches to sync for /v1, Resource=configmaps
2021/12/15 12:08:11 --> ADD kube-public/cluster-info
2021/12/15 12:08:11 --> ADD kube-system/extension-apiserver-authentication
2021/12/15 12:08:11 --> ADD tekton-pipelines/config-logging
...
2021/12/15 12:08:11 LISTING CONFIGMAPS
2021/12/15 12:08:11 - coredns
2021/12/15 12:08:11 - extension-apiserver-authentication
2021/12/15 12:08:11 - kube-proxy
2021/12/15 12:08:11 - kube-root-ca.crt
2021/12/15 12:08:11 - kubeadm-config
2021/12/15 12:08:11 - kubelet-config-1.21

THIS IS AN EXPERIMENT

None of this is anywhere near set in stone. The name client-go2 is a placeholder, and a joke.