Skip to content

fix(zrpc): clarify Kubernetes EndpointSlice RBAC errors - #5710

Open
014-code wants to merge 5 commits into
zeromicro:masterfrom
014-code:fix/k8s-endpointslice-rbac-error
Open

fix(zrpc): clarify Kubernetes EndpointSlice RBAC errors#5710
014-code wants to merge 5 commits into
zeromicro:masterfrom
014-code:fix/k8s-endpointslice-rbac-error

Conversation

@014-code

@014-code 014-code commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #5617.

The Kubernetes RPC resolver already supports k8s://<namespace>/<service>:<port>, but when the client service account lacks permission to read EndpointSlices, the old error was misleading and looked like the service was not started.

This PR improves that failure path by wrapping EndpointSlice list errors with a clearer message that points to the required RBAC permissions on endpointslices.discovery.k8s.io (get, list, watch).

It also adds a short Kubernetes RPC discovery note to readme.md with the target format and the minimal RBAC example.

Tests

  • go test ./zrpc/...
  • go test ./zrpc/resolver/internal -run 'TestKubeBuilder|TestWrapEndpointSliceListError' -count=1

@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Bug: In some released go-zero version, RPC service discovery failed in a k8s environment

1 participant