devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.28k stars 359 forks source link

Pull Secret creation fails with Azure Container Registry when using az cli for login #2278

Closed andrstor closed 2 years ago

andrstor commented 2 years ago

What happened?
When using recommended login to Azure Container Registry:

az login
az acr login -n <registry>

the entry in .docker/config.json is not accepted by devspace when using the Pull Secrets capability.

Running

devspace deploy

does not create a pull-secret. After printing "Ensuring image pull secret for registry:", the create part never happens.

If we instead use the Azure Container Registry admin account for login:

docker login <acr> --username <adminaccount>--password <passord>

This works as expected when deploying with devspace:

pullsecret:helsenorge Ensuring image pull secret for registry: 
pullsecret:helsenorge Created image pull secret dev/devspace-pull-secrets

The difference between the .docker/config.json az acr login:

{
    "auths": {
        "<>.azurecr.io": {
            "auth": "...",
            "identitytoken":"..."
        }
    }
}

docker login with admin account

{
    "auths": {
        "<>.azurecr.io": {
            "auth": "..."
        }
    }
}

What did you expect to happen instead?
Logging in with az acr login with your private account should work in the same way as logging in with an admin account. It should atleast give a clear error message about why the secret was not created.

How can we reproduce the bug? (as minimally and precisely as possible)

My devspace.yaml:

pullSecrets:
  helsenorge:
    registry: <>.azurecr.io

Local Environment:

Anything else we need to know?

/kind bug

FabianKramm commented 2 years ago

@andrstor thanks for creating this issue! We'll investigate this and issue a fix for one of the next releases