Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/oci/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl AuthConfig {
Ok(())
}

fn default_path() -> Result<PathBuf> {
pub(crate) fn default_path() -> Result<PathBuf> {
Ok(dirs::config_dir()
.context("Cannot find configuration directory")?
.join("fermyon")
Expand Down
4 changes: 3 additions & 1 deletion crates/oci/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,9 @@ impl Client {
// First, validate the credentials. If a user accidentally enters a wrong credential set, this
// can catch the issue early rather than getting an error at the first operation that needs
// to use the credentials (first time they do a push/pull/up).
Self::validate_credentials(&server, &username, &password).await?;
if let Err(_) = Self::validate_credentials(&server, &username, &password).await {
tracing::error!("Cannot validate regsitry credentials. The server does not accept this operation, or the credentials might be wrong. Adding the credentials to the configuration and attempting to use them in future registry operations. You can check the registries spin is logged in at {:?}", AuthConfig::default_path()?);
}

// Save an encoded representation of the credential set in the local configuration file.
let mut auth = AuthConfig::load_default().await?;
Expand Down