Skip to content

Update k8s-agent go 1.26.1#296

Open
oleksandrsan wants to merge 2 commits intomainfrom
update-go-1.26.1
Open

Update k8s-agent go 1.26.1#296
oleksandrsan wants to merge 2 commits intomainfrom
update-go-1.26.1

Conversation

@oleksandrsan
Copy link
Contributor

Changes

  1. Update Go to 1.26.1
  2. Opt out of the new WatchList protocol which is default in client-go 0.35.
  • Context: client-go v0.35 enables the WatchListClient feature gate by default, which changes how the
    reflector initializes informers. It now expects watchers to implement the WatchList
    protocol (sending Added events followed by a Bookmark).
  • Issue: The PodMetrics informer uses a custom polling-based watch shim (metricsWatch) because the
    metrics API doesn't support native watching. This shim doesn't implement the WatchList
    protocol, causing the reflector to enter a retry loop where it repeatedly creates and
    stops watchers, never syncing. The repeated Stop() calls also triggered a close of closed
    channel panic.
  • Fix (also mentioned in istio client):
    • Opt the PodMetrics ListWatch out of WatchList semantics via
      IsWatchListSemanticsUnSupported(), so the reflector falls back to the classic list+watch
      flow.
    • Guard metricsWatch.Stop() with sync.Once to prevent double-close panics.

Testing

✅ Lint passed
✅ Tests passed with race detector (go test ./... -race)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant