Skip to content

Commit

Permalink
Added some debugging print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jessie-union committed Aug 28, 2024
1 parent f70d4e3 commit d26f1f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions api/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,19 @@ impl ConfigV2 {
return false;
}
if let Some(backend_cfg) = self.backend.as_ref() {
log::info!("validating backend config: {:?}", backend_cfg);
if !backend_cfg.validate() {
return false;
}
}
if let Some(cache_cfg) = self.cache.as_ref() {
log::info!("validating cache config: {:?}", cache_cfg);
if !cache_cfg.validate() {
return false;
}
}
if let Some(rafs_cfg) = self.rafs.as_ref() {
log::info!("validating rafs config: {:?}", rafs_cfg);
if !rafs_cfg.validate() {
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions storage/src/backend/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,9 @@ impl RegistryState {
("password", self.password.as_str()),
("client_id", REGISTRY_CLIENT_ID),
];

let mut headers = HeaderMap::new();

// Insert the basic auth header to ensure the compatibility (e.g. Harbor registry)
// of fetching token by HTTP GET method.
// This refers containerd implementation: https://github.com/containerd/containerd/blob/dc7dba9c20f7210c38e8255487fc0ee12692149d/remotes/docker/auth/fetch.go#L187
Expand All @@ -348,7 +348,7 @@ impl RegistryState {
format!("Basic {}", auth).parse().unwrap(),
);
}

// Print out the GET request details
let query_string: Vec<String> = query.iter().map(|(k, v)| format!("{}={}", k, v)).collect();
let curl_command = format!(
Expand All @@ -358,7 +358,7 @@ impl RegistryState {
query_string.join("&")
);
println!("Invoke the following curl command:\n{}", curl_command);

let token_resp = connection
.call::<&[u8]>(
Method::GET,
Expand Down

0 comments on commit d26f1f4

Please sign in to comment.