From d7fbeff3742bb913d9b67e7c4c4fa518c7121acf Mon Sep 17 00:00:00 2001 From: Paulo Bressan Date: Fri, 27 Sep 2024 12:23:43 -0300 Subject: [PATCH] fix: removed hbs invalid comma (#140) --- src/domain/resource/command.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/domain/resource/command.rs b/src/domain/resource/command.rs index 088dac9..7145286 100644 --- a/src/domain/resource/command.rs +++ b/src/domain/resource/command.rs @@ -5,7 +5,7 @@ use base64::{prelude::BASE64_STANDARD_NO_PAD, Engine}; use bech32::{Bech32m, Hrp}; use chrono::Utc; use rand::rngs::OsRng; -use tracing::info; +use tracing::{error, info}; use uuid::Uuid; use crate::domain::{ @@ -34,11 +34,10 @@ pub async fn fetch( .await? .into_iter() .map(|mut resource| { - if let Ok(annotations) = - metadata.render_hbs(&resource.kind.to_lowercase(), &resource.spec) - { - resource.annotations = Some(annotations); - } + match metadata.render_hbs(&resource.kind.to_lowercase(), &resource.spec) { + Ok(annotations) => resource.annotations = Some(annotations), + Err(error) => error!(?error), + }; resource }) @@ -59,9 +58,10 @@ pub async fn fetch_by_id( assert_project_permission(project_cache.clone(), &cmd.credential, &resource.project_id).await?; - if let Ok(annotations) = metadata.render_hbs(&resource.kind.to_lowercase(), &resource.spec) { - resource.annotations = Some(annotations); - } + match metadata.render_hbs(&resource.kind.to_lowercase(), &resource.spec) { + Ok(annotations) => resource.annotations = Some(annotations), + Err(error) => error!(?error), + }; Ok(resource) }