@@ -4,15 +4,16 @@ import (
44 "context"
55 "encoding/base64"
66 "encoding/json"
7- devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
8- "github.com/loft-sh/devspace/pkg/devspace/kubectl"
9- command2 "github.com/loft-sh/loft-util/pkg/command"
10- "github.com/sirupsen/logrus"
117 "io"
128 "os"
139 "path/filepath"
1410 "strings"
1511
12+ devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
13+ "github.com/loft-sh/devspace/pkg/devspace/kubectl"
14+ command2 "github.com/loft-sh/loft-util/pkg/command"
15+ "github.com/sirupsen/logrus"
16+
1617 "github.com/docker/cli/cli/streams"
1718 "github.com/loft-sh/devspace/pkg/devspace/build/builder/restart"
1819
@@ -112,13 +113,21 @@ func (b *Builder) BuildImage(ctx devspacecontext.Context, contextPath, dockerfil
112113
113114 // Authenticate
114115 if ! b .skipPush && ! b .helper .ImageConf .SkipPush {
115- ctx .Log ().Info ("Authenticating (" + displayRegistryURL + ")..." )
116- _ , err = b .Authenticate (ctx .Context ())
117- if err != nil {
118- return errors .Errorf ("Error during image registry authentication: %v" , err )
119- }
116+ if pullsecrets .IsAzureContainerRegistry (registryURL ) {
117+ ctx .Log ().Warn ("Using an Azure Container Registry(ACR), skipping authentication. You may need to refresh your credentials by running 'az acr login'" )
118+ b .authConfig , err = b .client .GetAuthConfig (ctx .Context (), registryURL , true )
119+ if err != nil {
120+ return err
121+ }
122+ } else {
123+ ctx .Log ().Info ("Authenticating (" + displayRegistryURL + ")..." )
124+ _ , err = b .Authenticate (ctx .Context ())
125+ if err != nil {
126+ return errors .Errorf ("Error during image registry authentication: %v" , err )
127+ }
120128
121- ctx .Log ().Done ("Authentication successful (" + displayRegistryURL + ")" )
129+ ctx .Log ().Done ("Authentication successful (" + displayRegistryURL + ")" )
130+ }
122131 }
123132
124133 // Buildoptions
0 commit comments