Skip to content

Commit

Permalink
fix: do not exit argocd sync loop when status response is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
bbortt committed Sep 19, 2024
1 parent b30b73f commit 66f3dd2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/argo_cd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,12 @@ impl ArgoCD {
.expect("Failed to request ArgoCD sync status");

if response.status().is_success() {
let app_information: Application = self
.rt
.block_on(response.json())
.expect("Failed to read ArgoCD sync status response");
let response: Option<Application> = self.rt.block_on(response.json()).ok();
let app_information: Application = if response.is_none() {
continue;
} else {
response.unwrap()

Check failure on line 184 in src/argo_cd.rs

View workflow job for this annotation

GitHub Actions / Binary Full-Build

called `unwrap` on `response` after checking its variant with `is_none`
};

debug!("ArgoCD sync status response: {:?}", app_information);

Expand Down

0 comments on commit 66f3dd2

Please sign in to comment.