Skip to content

Commit

Permalink
Restored (metalbear-co#2735)
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 authored Sep 5, 2024
1 parent 0abe84b commit 4d7c218
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions changelog.d/ls-concurrency.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Restored concurrency in `mirrord ls` list requests.
26 changes: 13 additions & 13 deletions mirrord/kube/src/api/kubernetes/seeker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ impl KubeResourceSeeker<'_> {
/// Returns all resource types that don't require the operator to operate ie. [`Pod`],
/// [`Deployment`] and [`Rollout`]
pub async fn all_open_source(&self) -> Result<Vec<String>> {
let pods = self.pods().await?;
let deployments = self.deployments().await?;
let rollouts = self.simple_list_resource::<Rollout>("rollout").await?;
let (pods, deployments, rollouts) = tokio::try_join!(
self.pods(),
self.deployments(),
self.simple_list_resource::<Rollout>("rollout")
)?;

Ok(pods
.into_iter()
Expand All @@ -44,16 +46,14 @@ impl KubeResourceSeeker<'_> {
/// Returns all resource types ie. [`Pod`], [`Deployment`], [`Rollout`], [`Job`], [`CronJob`],
/// and [`StatefulSet`]
pub async fn all(&self) -> Result<Vec<String>> {
let pods = self.pods().await?;
let deployments = self
.simple_list_resource::<Deployment>("deployment")
.await?;
let rollouts = self.simple_list_resource::<Rollout>("rollout").await?;
let jobs = self.simple_list_resource::<Job>("job").await?;
let cronjobs = self.simple_list_resource::<CronJob>("cronjob").await?;
let statefulsets = self
.simple_list_resource::<StatefulSet>("statefulset")
.await?;
let (pods, deployments, rollouts, jobs, cronjobs, statefulsets) = tokio::try_join!(
self.pods(),
self.simple_list_resource::<Deployment>("deployment"),
self.simple_list_resource::<Rollout>("rollout"),
self.simple_list_resource::<Job>("job"),
self.simple_list_resource::<CronJob>("cronjob"),
self.simple_list_resource::<StatefulSet>("statefulset"),
)?;

Ok(pods
.into_iter()
Expand Down

0 comments on commit 4d7c218

Please sign in to comment.