Skip to content

Commit

Permalink
Return error if status code was not 404 on api error
Browse files Browse the repository at this point in the history
  • Loading branch information
zlepper committed May 23, 2024
1 parent 34ee051 commit 971aac4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/replace_service_reconciler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -924,13 +924,14 @@ async fn change_keda_replicas(

let patch = Patch::Merge(&scaled_object_patch);
match api.patch(name, &PatchParams::default(), &patch).await {
Ok(_) => {},
Ok(_) => Ok(()),
Err(kube::Error::Api(api_error)) => {
if api_error.code == 404 {
return Ok(())
Ok(())
} else {
Err(api_error.into())
}
}
Err(e) => return Err(e.into())
Err(e) => Err(e.into())
}
Ok(())
}

0 comments on commit 971aac4

Please sign in to comment.