Skip to content

Commit 62c3055

Browse files
fix:[CI-13562]:improve error message for anonymous connector used (#34)
* fix:[CI-12799]:improve error message for anonymous connector used * fix:[CI-13562]:improve error message for anonymous connector used fix:[CI-13562]:typo * fix:[CI-13562]: add error in command login too * check for registry empty
1 parent 68fd0a6 commit 62c3055

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docker.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,13 @@ func (p Plugin) Exec() error {
178178

179179
// add base image docker credentials to the existing config file, else create new
180180
// instead of writing to config file directly, using docker's login func
181-
if p.BaseImagePassword != "" {
181+
if p.BaseImageRegistry != "" {
182+
if p.BaseImageUsername == "" {
183+
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.")
184+
}
185+
if p.BaseImagePassword == "" {
186+
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.")
187+
}
182188
var baseConnectorLogin Login
183189
baseConnectorLogin.Registry = p.BaseImageRegistry
184190
baseConnectorLogin.Username = p.BaseImageUsername

0 commit comments

Comments
 (0)