@@ -167,17 +167,20 @@ func (impl *DockerHelperImpl) StartDockerDaemonAndDockerLogin(commonWorkflowRequ
167167 util .PrintFileContent (DOCKERD_OUTPUT_FILE_PATH )
168168 return err
169169 }
170- ciContext := cicxt .BuildCiContext (context .Background (), commonWorkflowRequest .EnableSecretMasking )
171- err = impl .DockerLogin (ciContext , & DockerCredentials {
172- DockerUsername : commonWorkflowRequest .DockerUsername ,
173- DockerPassword : commonWorkflowRequest .DockerPassword ,
174- AwsRegion : commonWorkflowRequest .AwsRegion ,
175- AccessKey : commonWorkflowRequest .AccessKey ,
176- SecretKey : commonWorkflowRequest .SecretKey ,
177- DockerRegistryURL : commonWorkflowRequest .IntermediateDockerRegistryUrl ,
178- DockerRegistryType : commonWorkflowRequest .DockerRegistryType ,
179- CredentialsType : commonWorkflowRequest .CredentialsType ,
180- })
170+ skipDockerLogin := len (commonWorkflowRequest .IntermediateDockerRegistryUrl ) == 0
171+ if ! skipDockerLogin {
172+ ciContext := cicxt .BuildCiContext (context .Background (), commonWorkflowRequest .EnableSecretMasking )
173+ err = impl .DockerLogin (ciContext , & DockerCredentials {
174+ DockerUsername : commonWorkflowRequest .DockerUsername ,
175+ DockerPassword : commonWorkflowRequest .DockerPassword ,
176+ AwsRegion : commonWorkflowRequest .AwsRegion ,
177+ AccessKey : commonWorkflowRequest .AccessKey ,
178+ SecretKey : commonWorkflowRequest .SecretKey ,
179+ DockerRegistryURL : commonWorkflowRequest .IntermediateDockerRegistryUrl ,
180+ DockerRegistryType : commonWorkflowRequest .DockerRegistryType ,
181+ CredentialsType : commonWorkflowRequest .CredentialsType ,
182+ })
183+ }
181184 if err != nil {
182185 return err
183186 }
0 commit comments