Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 6 additions & 1 deletion docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ func (p Plugin) Exec() error {
baseConnectorLogin.Password = p.BaseImagePassword

cmd := commandLogin(baseConnectorLogin)

if p.BaseImageUsername == "" {
return fmt.Errorf("Username cannot be empty. The base image connector requires authenticated access. Please either use an authenticated connector, or remove the base image connector.")
}
if p.BaseImagePassword == "" {
return fmt.Errorf("Password cannot be empty. The base image connector requires authenticated access. Please either use an authenticated connector, or remove the base image connector.")
}
raw, err := cmd.CombinedOutput()
if err != nil {
out := string(raw)
Expand Down
4 changes: 2 additions & 2 deletions internal/docker/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ func (c *Config) CreateDockerConfigJson(credentials []RegistryCredentials) ([]by
if cred.Registry != "" {

if cred.Username == "" {
return nil, fmt.Errorf("Username must be specified for registry: %s", cred.Registry)
return nil, fmt.Errorf("Username cannot be empty. The base image connector requires authenticated access. Please either use an authenticated connector, or remove the base image connector.")
}
if cred.Password == "" {
return nil, fmt.Errorf("Password must be specified for registry: %s", cred.Registry)
return nil, fmt.Errorf("Password cannot be empty. The base image connector requires authenticated access. Please either use an authenticated connector, or remove the base image connector.")
}
c.SetAuth(cred.Registry, cred.Username, cred.Password)
}
Expand Down