Skip to content

Use WatchListXXXForAllNamespacesAsync to list Kubernetes resources and refactor WatchAsync#3024

Merged
MihaZupan merged 15 commits into
dotnet:mainfrom
Xulei-NL:refactor/asyncwatch-k8s-resources
Jun 8, 2026
Merged

Use WatchListXXXForAllNamespacesAsync to list Kubernetes resources and refactor WatchAsync#3024
MihaZupan merged 15 commits into
dotnet:mainfrom
Xulei-NL:refactor/asyncwatch-k8s-resources

Conversation

@Xulei-NL

@Xulei-NL Xulei-NL commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

This PR

  1. Replace WatchListXXXForAllNamespaces with WatchListXXXForAllNamespacesAsync. For instace WatchListEndpointsForAllNamespaces with WatchListEndpointsForAllNamespacesAsync. If so, we could get watch results asynchrounously.
  2. Refactor WatchAsync to handle returned IAsyncEnumerable(<WatchEventType, TResource>) in step 1. In this way we could remove TaskCompletionSource which simulates a Task and rely on await foreach.

Appreciate every feedback!

Closes #3008

@Xulei-NL

Copy link
Copy Markdown
Contributor Author

The PR for the issue #3008.

@Xulei-NL

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@MihaZupan MihaZupan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

Comment thread src/Kubernetes.Controller/Client/V1IngressResourceInformer.cs Outdated
Comment thread src/Kubernetes.Controller/Client/ResourceInformer.cs Outdated
Comment thread src/Kubernetes.Controller/Client/ResourceInformer.cs Outdated
Comment thread src/Kubernetes.Controller/Client/ResourceInformer.cs Outdated
Comment thread src/Kubernetes.Controller/Client/ResourceInformer.cs Outdated
Comment thread src/Kubernetes.Controller/Client/ResourceInformer.cs Outdated
@Xulei-NL Xulei-NL requested a review from MihaZupan May 28, 2026 08:42
@MihaZupan MihaZupan merged commit dd782cb into dotnet:main Jun 8, 2026
7 checks passed
@Xulei-NL Xulei-NL deleted the refactor/asyncwatch-k8s-resources branch June 8, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Kubernetes.Controller] Switch from WatchListXXX to WatchListXXXAsync in WatchResourceListAsync

2 participants