log available credentials before login

This commit is contained in:
Brad Rydzewski 2021-08-02 22:15:39 -04:00
parent fbbeec5a2e
commit 72ef7b1f3f
1 changed files with 14 additions and 10 deletions

View File

@ -93,7 +93,20 @@ func (p Plugin) Exec() error {
time.Sleep(time.Second * 1)
}
// Create Auth Config File
// for debugging purposes, log the type of authentication
// credentials that have been provided.
switch {
case p.Login.Password != "" && p.Login.Config != "":
fmt.Println("Detected registry credentials and registry credentials file")
case p.Login.Password != "":
fmt.Println("Detected registry credentials")
case p.Login.Config != "":
fmt.Println("Detected registry credentials file")
default:
fmt.Println("Registry credentials or Docker config not provided. Guest mode enabled.")
}
// create Auth Config File
if p.Login.Config != "" {
os.MkdirAll(dockerHome, 0600)
@ -116,15 +129,6 @@ func (p Plugin) Exec() error {
}
}
switch {
case p.Login.Password != "":
fmt.Println("Detected registry credentials")
case p.Login.Config != "":
fmt.Println("Detected registry credentials file")
default:
fmt.Println("Registry credentials or Docker config not provided. Guest mode enabled.")
}
if p.Build.Squash && !p.Daemon.Experimental {
fmt.Println("Squash build flag is only available when Docker deamon is started with experimental flag. Ignoring...")
p.Build.Squash = false