Skip to content

Commit

Permalink
fix: Make Api namespaced for patching status
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalezzfelipe committed Nov 1, 2024
1 parent fd6ea53 commit f06d308
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,14 @@ impl K8sContext {

async fn patch_statuses(&self) -> anyhow::Result<()> {
let api: Api<HydraDoomNode> = Api::all(self.client.clone());

let crds = api.list(&ListParams::default()).await?;

let mut awaitables = vec![];
for crd in &crds {
awaitables.push(async {
let name = crd.name_any();
let api: Api<HydraDoomNode> =
Api::namespaced(self.client.clone(), &crd.namespace().unwrap());
if let Err(err) = api
.patch_status(
&name,
Expand All @@ -359,7 +360,10 @@ impl K8sContext {
)
.await
{
warn!(err = err.to_string(), "Failed to status for CRD.");
warn!(
err = err.to_string(),
"Failed to update status for CRD {}.", name
);
};
})
}
Expand Down

0 comments on commit f06d308

Please sign in to comment.