-
Notifications
You must be signed in to change notification settings - Fork 132
migrate from v1.Endpoints to discoveryv1.EndpointSlices #1298
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
Conversation
b835ef9
to
b164bc8
Compare
Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
b164bc8
to
a90a71d
Compare
fc398ef
to
13b830c
Compare
tests/checks/scaling_phase_statefulset/scaling_phase_statefulset_test.go
Show resolved
Hide resolved
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
2f55a52
to
c243ac4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates from Kubernetes v1.Endpoints to discovery/v1.EndpointSlices API to modernize the endpoint discovery mechanism. This is a breaking change that improves compatibility with newer Kubernetes versions but may break support for older clusters.
- Migration from v1.Endpoints to discoveryv1.EndpointSlices across the entire codebase
- Update RBAC permissions to access discovery.k8s.io API group instead of core v1
- Refactor endpoint data structure access patterns to use EndpointSlice.Endpoints instead of Endpoints.Subsets
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
tests/checks/interceptor_websocket/interceptor_websocket_test.go | Remove version tag from test container image |
scaler/queue_pinger_test.go | Update test imports and function signatures to use EndpointSlice |
scaler/main.go | Update RBAC annotation for EndpointSlices API access |
pkg/k8s/fake_endpoints.go | Refactor fake endpoint creation to use EndpointSlice structure |
pkg/k8s/endpoints_test.go | Update tests to use EndpointSlice data structures and assertions |
pkg/k8s/endpoints_cache_informer.go | Migrate informer to use EndpointSlice with label-based service selection |
pkg/k8s/endpoints_cache_fake.go | Update fake cache implementation for EndpointSlice compatibility |
pkg/k8s/endpoints_cache.go | Update interface signature to return EndpointSlice |
pkg/k8s/endpoints.go | Migrate endpoint retrieval functions to use EndpointSlice API |
operator/controllers/http/ping_test.go | Update test to handle EndpointSlice address structure |
interceptor/proxy_handlers_integration_test.go | Update integration tests to use EndpointSlice objects |
interceptor/main.go | Update RBAC annotation for EndpointSlices API access |
interceptor/forward_wait_func_test.go | Update test helper functions to create EndpointSlice objects |
interceptor/forward_wait_func.go | Update endpoint counting logic for EndpointSlice structure |
config/scaler/role.yaml | Update RBAC role to access discovery.k8s.io/endpointslices |
config/interceptor/role.yaml | Update RBAC role to access discovery.k8s.io/endpointslices |
CHANGELOG.md | Document breaking change migration from v1.Endpoints to EndpointSlices |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
f2948a7
to
4e4a1a5
Compare
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
* Migration to EndpointSlices Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com> * finish migration from v1.Endpoints to discoveryv1.EndpointSlices Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> * handle multiple EndpointSlices per service Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> * remove deletecollection rbac for endpoint slices Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> --------- Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com> Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com>
* Migration to EndpointSlices Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com> * finish migration from v1.Endpoints to discoveryv1.EndpointSlices Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> * handle multiple EndpointSlices per service Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> * remove deletecollection rbac for endpoint slices Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> --------- Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com> Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com>
* Migration to EndpointSlices Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com> * finish migration from v1.Endpoints to discoveryv1.EndpointSlices Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> * handle multiple EndpointSlices per service Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> * remove deletecollection rbac for endpoint slices Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> --------- Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com> Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com>
Fixes #1297