fix: Make sure username, password, and registry are not empty
This commit is contained in:
parent
0b29929e93
commit
e9c1df272e
1 changed files with 14 additions and 1 deletions
|
|
@ -256,7 +256,20 @@ impl Driver<'_> {
|
|||
pub fn init(self) -> Result<()> {
|
||||
trace!("Driver::init()");
|
||||
let init = INIT.lock().map_err(|e| anyhow!("{e}"))?;
|
||||
credentials::set_user_creds(self.username, self.password, self.registry)?;
|
||||
credentials::set_user_creds(
|
||||
match self.username {
|
||||
Some(username) if !username.is_empty() => Some(username),
|
||||
_ => None,
|
||||
},
|
||||
match self.password {
|
||||
Some(password) if !password.is_empty() => Some(password),
|
||||
_ => None,
|
||||
},
|
||||
match self.registry {
|
||||
Some(registry) if !registry.is_empty() => Some(registry),
|
||||
_ => None,
|
||||
},
|
||||
)?;
|
||||
|
||||
let mut build_driver = SELECTED_BUILD_DRIVER.lock().map_err(|e| anyhow!("{e}"))?;
|
||||
let mut inspect_driver = SELECTED_INSPECT_DRIVER.lock().map_err(|e| anyhow!("{e}"))?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue