From 429002cc3942cfb26018ac4f80eb7c7a303e8872 Mon Sep 17 00:00:00 2001 From: Xynnn007 Date: Thu, 11 Jul 2024 16:46:56 +0800 Subject: [PATCH] cdh & image-rs: add debug patch Signed-off-by: Xynnn007 --- Cargo.lock | 9 ++++++--- confidential-data-hub/hub/src/bin/ttrpc_server/mod.rs | 8 ++++++-- image-rs/src/image.rs | 7 +------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 99d91b38c..c1cfec58d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -408,7 +408,8 @@ dependencies = [ [[package]] name = "az-cvm-vtpm" version = "0.6.0" -source = "git+http://github.com/mkulke/azure-cvm-tooling?rev=69526229dbb78fe4a5d6e8c6887a146d8c6640b0#69526229dbb78fe4a5d6e8c6887a146d8c6640b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1940b5a30bbaa585acd365e329c8c4c5c119345fef81830bd5f38f2360caa7d6" dependencies = [ "bincode", "jsonwebkey", @@ -427,7 +428,8 @@ dependencies = [ [[package]] name = "az-snp-vtpm" version = "0.6.0" -source = "git+http://github.com/mkulke/azure-cvm-tooling?rev=69526229dbb78fe4a5d6e8c6887a146d8c6640b0#69526229dbb78fe4a5d6e8c6887a146d8c6640b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a276bcc39a8cf650ebc32941409f89c751cf8266c67f233872ac8c50ffa5405" dependencies = [ "az-cvm-vtpm", "bincode", @@ -441,7 +443,8 @@ dependencies = [ [[package]] name = "az-tdx-vtpm" version = "0.6.0" -source = "git+http://github.com/mkulke/azure-cvm-tooling?rev=69526229dbb78fe4a5d6e8c6887a146d8c6640b0#69526229dbb78fe4a5d6e8c6887a146d8c6640b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb795802e685a153ea4906349c86f5760012478a72e349538dd47012409465de" dependencies = [ "az-cvm-vtpm", "base64-url", diff --git a/confidential-data-hub/hub/src/bin/ttrpc_server/mod.rs b/confidential-data-hub/hub/src/bin/ttrpc_server/mod.rs index aff8ffcd9..053fd66a8 100644 --- a/confidential-data-hub/hub/src/bin/ttrpc_server/mod.rs +++ b/confidential-data-hub/hub/src/bin/ttrpc_server/mod.rs @@ -92,7 +92,9 @@ impl GetResourceService for Server { error!("[ttRPC CDH] GetResource :\n{detailed_error}"); let mut status = Status::new(); status.set_code(Code::INTERNAL); - status.set_message("[CDH] [ERROR]: Get Resource failed".into()); + status.set_message(format!( + "[CDH] [ERROR]: Get Resource failed, err: {detailed_error}" + )); Error::RpcStatus(status) })?; @@ -136,7 +138,9 @@ impl KeyProviderService for Server { error!("[ttRPC CDH] UnWrapKey :\n{detailed_error}"); let mut status = Status::new(); status.set_code(Code::INTERNAL); - status.set_message("[CDH] [ERROR]: UnwrapKey failed".to_string()); + status.set_message(format!( + "[CDH] [ERROR]: UnwrapKey failed, err: {detailed_error}" + )); Error::RpcStatus(status) })?; diff --git a/image-rs/src/image.rs b/image-rs/src/image.rs index 5fc73c876..ccedb0977 100644 --- a/image-rs/src/image.rs +++ b/image-rs/src/image.rs @@ -3,7 +3,6 @@ // SPDX-License-Identifier: Apache-2.0 use anyhow::{anyhow, bail, Result}; -use log::warn; use oci_distribution::manifest::{OciDescriptor, OciImageManifest}; use oci_distribution::secrets::RegistryAuth; use oci_distribution::Reference; @@ -229,11 +228,7 @@ impl ImageClient { { Ok(cred) => cred, Err(e) => { - warn!( - "get credential failed, use Anonymous auth instead: {}", - e.to_string() - ); - RegistryAuth::Anonymous + bail!("Failed to get registry auth: {:?}", e) } } }