Addresses all review comments from PR #2446: 1. Add validation for QPS and Burst values - QPS must be > 0 - Burst must be >= 1 - Returns clear error messages for invalid values 2. Fix client config loading - Use clientcmd.NewDefaultClientConfigLoadingRules() for proper fallback - Only override ExplicitPath when kubeconfig is provided - Ensures standard env var handling and ~/.kube/config fallback 3. Improve cache locking - Use double-check locking pattern to avoid holding mutex during client creation - Reduces contention when multiple goroutines create clients concurrently 4. Add comprehensive tests - Test validation of invalid QPS values - Test validation of invalid Burst values - Test successful creation with valid values - Ensure error messages are descriptive 5. Fix documentation link - Updated Kubernetes client-go rate limiting link to point to correct rest.Config documentation - Previous link pointed to API server event rate limiting All tests pass and code quality checks succeed. Signed-off-by: yxxhero <aiopsclub@163.com> |
||
|---|---|---|
| .. | ||
| options.go | ||
| tracker.go | ||
| tracker_test.go | ||