projectcapsule / capsule-proxy

Reverse proxy for Capsule Operator.
https://github.com/projectcapsule/capsule
Apache License 2.0
44 stars 40 forks source link

Catchall should consider APIs only with GET, LIST, and WATCH capabilities #459

Closed prometherion closed 4 months ago

prometherion commented 4 months ago

Bug description

When running the feature gate ProxyAllNamespaced there are several error messages of the reflector trying to WATCH resources that don't have this capability.

A generic example is the PodMetrics one which is a special API object that doesn't provide the WATCH verb.

How to reproduce

  1. start Capsule Proxy with the ProxyAllNamespaced=true feature gate
  2. check the logs

Expected behaviour

APIs with no WATCH capabilities should ignored.

Logs

E0606 14:20:43.102227       1 reflector.go:147] k8s.io/client-go@v0.28.4/tools/cache/reflector.go:229: Failed to watch metrics.k8s.io/v1beta1, Kind=PodMetrics: the server does not allow this method on the requested resource

Additional context