From 971aac4dbdf2eb25bae20b44e5ca7efc3c10fc20 Mon Sep 17 00:00:00 2001 From: zlepper Date: Thu, 23 May 2024 11:00:55 +0200 Subject: [PATCH] Return error if status code was not 404 on api error --- src/replace_service_reconciler.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/replace_service_reconciler.rs b/src/replace_service_reconciler.rs index cd6c181..2135449 100644 --- a/src/replace_service_reconciler.rs +++ b/src/replace_service_reconciler.rs @@ -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(()) }