Skip to content

Commit 9a42f3e

Browse files
authored
Merge pull request #2284 from lizardruss/fix-acr-login
fix: use identity token when password is not set
2 parents 8ab1a66 + 62364e7 commit 9a42f3e

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/devspace/docker/auth.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ func (c *client) Login(ctx context.Context, registryURL, user, password string,
3939
}
4040

4141
authConfig, err := getDefaultAuthConfig(checkCredentialsStore, serverAddress, isDefaultRegistry)
42-
authConfig.IdentityToken = ""
4342
if err != nil || authConfig.Username == "" || authConfig.Password == "" || relogin {
4443
authConfig.Username = strings.TrimSpace(user)
4544
authConfig.Password = strings.TrimSpace(password)

pkg/devspace/pullsecrets/init.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package pullsecrets
22

33
import (
4+
"time"
5+
46
devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
57
"github.com/loft-sh/devspace/pkg/devspace/docker"
68
"github.com/loft-sh/devspace/pkg/util/stringutil"
7-
"time"
89

910
"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
1011
"github.com/loft-sh/devspace/pkg/devspace/hook"
@@ -166,6 +167,10 @@ func (r *client) createPullSecret(ctx devspacecontext.Context, dockerClient dock
166167
if authConfig != nil {
167168
username = authConfig.Username
168169
password = authConfig.Password
170+
171+
if password == "" && authConfig.IdentityToken != "" {
172+
password = authConfig.IdentityToken
173+
}
169174
}
170175
}
171176

0 commit comments

Comments
 (0)