Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.
Open
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 builtin/docker/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ func (p *Platform) pullImage(cli *client.Client, log hclog.Logger, ui terminal.U

var authBase64 = ""
//Check if auth configuration is not null
if (*p.config.Auth != Auth{}) {
if p.config.Auth != nil && *p.config.Auth != (Auth{}) {
auth := types.AuthConfig{
Username: authConfig.Username,
Password: authConfig.Password,
Expand Down
4 changes: 2 additions & 2 deletions builtin/docker/pull/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func (b *Builder) buildWithDocker(
return status.Errorf(codes.Internal, "unable to generate authentication info for registry: %s", err)
}
encodedAuth = base64.URLEncoding.EncodeToString(buf)
} else if *b.config.Auth != (docker.Auth{}) {
} else if b.config.Auth != nil && *b.config.Auth != (docker.Auth{}) {
//If EncodedAuth is not set, and Auth is, use Auth
authBytes, err := json.Marshal(types.AuthConfig{
Username: authConfig.Username,
Expand Down Expand Up @@ -394,7 +394,7 @@ func (b *Builder) buildWithImg(
env := os.Environ()

//Check if auth configuration is not null
if (*b.config.Auth != docker.Auth{}) {
if b.config.Auth != nil && *b.config.Auth != (docker.Auth{}) {
auth, err := json.Marshal(types.AuthConfig{
Username: authConfig.Username,
Password: authConfig.Password,
Expand Down
2 changes: 1 addition & 1 deletion builtin/docker/registry_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (r *Registry) pushWithDocker(
return status.Errorf(codes.Internal, "unable to generate authentication info for registry: %s", err)
}
encodedAuth = base64.URLEncoding.EncodeToString(buf)
} else if (*r.config.Auth != Auth{}) {
} else if r.config.Auth != nil && *r.config.Auth != (Auth{}) {
if authConfig.Hostname != "" {
return status.Errorf(codes.InvalidArgument, "hostname not supported for registry")
}
Expand Down