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 4c773ed
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/argo_cd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,15 @@ 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 app_information: Application;
let response: Some<Application> =

Check failure on line 181 in src/argo_cd.rs

View workflow job for this annotation

GitHub Actions / Binary Windows-Crosscompile

expected type, found variant `Some`

Check failure on line 181 in src/argo_cd.rs

View workflow job for this annotation

GitHub Actions / Binary Full-Build

expected type, found variant `Some`
self.rt.block_on(response.json()).unwrap_or_else(|| None);

Check failure on line 182 in src/argo_cd.rs

View workflow job for this annotation

GitHub Actions / Binary Windows-Crosscompile

closure is expected to take 1 argument, but it takes 0 arguments

Check failure on line 182 in src/argo_cd.rs

View workflow job for this annotation

GitHub Actions / Binary Full-Build

closure is expected to take 1 argument, but it takes 0 arguments

if (response.is_none()) {

Check warning on line 184 in src/argo_cd.rs

View workflow job for this annotation

GitHub Actions / Binary Windows-Crosscompile

unnecessary parentheses around `if` condition

Check failure on line 184 in src/argo_cd.rs

View workflow job for this annotation

GitHub Actions / Binary Full-Build

unnecessary parentheses around `if` condition
continue;
} else {
app_information = response.unwrap();
}

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

Expand Down

0 comments on commit 4c773ed

Please sign in to comment.