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
resource: Add Resource[Endpoints] and adapt existing watchers #23977
Conversation
326c10a
to
01d77ee
Compare
This pull request has been automatically marked as stale because it |
This pull request has not seen any activity since it was marked stale. |
01d77ee
to
076a3d8
Compare
076a3d8
to
6a4a97d
Compare
6a4a97d
to
39cabe5
Compare
39cabe5
to
ee57c6e
Compare
/test |
348f9ac
to
c71a567
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.
Now looks good to me 👍
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.
LGTM for me
c71a567
to
2fbc948
Compare
/test |
2fbc948
to
bfbf7fc
Compare
/test |
bfbf7fc
to
33984b4
Compare
/test Job 'Cilium-PR-K8s-1.26-kernel-net-next' failed: Click to show.Test Name
Failure Output
Jenkins URL: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.26-kernel-net-next/351/ If it is a flake and a GitHub issue doesn't already exist to track it, comment Then please upload the Jenkins artifacts to that issue. |
/test-1.26-net-next |
33984b4
to
e7257e8
Compare
/test |
Oh, it conflicts again. @joamaki can't I get the write access to your fork (maybe it's hard)? So that I can take care of resolve conflict and trigger the CI while you are sleeping. |
Add the option to transform the object before it's added to the store. Useful in situations where we want to store a subset of the data or a derivate object vs the upstream object. Signed-off-by: Jussi Maki <jussi@isovalent.com>
In preparation of making endpoints a Resource, allow transforming K8s Endpoints/EndpointSlices into our internal representation (k8s.Endpoints) and to store it in cache.Store, this adds the object metadata to it. The "EndpointSliceID" is included in k8s.Endpoints so it doesn't need to be passed separately. Signed-off-by: Jussi Maki <jussi@isovalent.com>
Add Resource[*Endpoints] which probes the api-server capabilities to pick the right upstream resource kind and expose endpoints with our internal type rather than requiring each use-site to figure this out on their own. Signed-off-by: Jussi Maki <jussi@isovalent.com>
- Remove endpoint and endpoint_slice watchers - Add "endpoints watcher" adapted from endpoint_slice watcher that uses Resource[*Endpoints] instead of informer. This keeps things the same downstream. - Adapts BGP speaker to only handle *k8s.Endpoints - Removes endpoint/endpointslice informers from operator and use resource instead Closes: cilium#23734 Signed-off-by: Jussi Maki <jussi@isovalent.com>
This was used by the EndpointSlice watcher to check whether there really existed an EndpointSlice in addition to the API server supporting them. Since EndpointSlices have been the default for many versions now, we don't need this level of paranoia. Signed-off-by: Jussi Maki <jussi@isovalent.com>
e7257e8
to
ed3573b
Compare
/test |
|
/test-1.16-4.19 |
Adds
Resource[*Endpoints]
which moves the resolving of the Endpoint or EndpointSlice into the constructor for the resource. K8sWatcher refactored to use theResource[*Endpoints]
and code cleaned up to work with just*Endpoints
rather than the 3 different kinds. Some messiness around collapsing them into one type and hiding the underlying resource kind. Please review those changes carefully (CachesSynced, metrics in endpoints watcher, ipcache.ResourceKindEndpoint). I've tried to keep existing behavior as much as I could, but could've potentially missed something.See individual commits and #23734 for motivation.