Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rest.Config.NegotiatedSerializer causes watches to be created with the wrong scheme #1654

Closed
howardjohn opened this issue Sep 3, 2021 · 0 comments · Fixed by #1664
Closed

Comments

@howardjohn
Copy link
Contributor

We are seeing errors like watch of *v1alpha2.Gateway ended with: an error on the server ("unable to decode an event from the watch stream: unable to decode watch event: no kind \"Gateway\" is registered for version \"gateway.networking.k8s.io/v1alpha2\" in scheme \"pkg/runtime/scheme.go:100\"") has prevented the request from succeeding?

But...

  • It works with a standard client-go informer
  • I turned on debug logs, got the exact watch request to the api-server, and run it with kubectl get --raw and it works
  • The controller actually works - its reading the resource its failing to watch. It almost seems like it can list but not watch?

After a lot of debugging, the root cause was setting rest.Config.NegotiatedSerializer in the rest config passed to the manager creation.

I am not sure if this is a bug or user error. If its a bug, the root cause is here:

if cfg.NegotiatedSerializer == nil {

The reason we have it set is we copy+pasted from https://github.com/kubernetes/kubectl/blob/652881798563c00c1895ded6ced819030bfaa4d7/pkg/cmd/util/kubectl_match_version.go#L115. I am not sure if there is a valid reason beyond that.

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 a pull request may close this issue.

1 participant