Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow ACR authentication using Azure CLI #586

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Sep 8, 2023

  1. feat: Allow ACR authentication using Azure CLI

    Install azure-cli in Docker image in order to use the `az acr login` command.
    
    Can be used with Azure Managed Identities with the following script:
    
    ```yaml
    ---
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: argocd-image-updater-config
      namespace: argocd
    data:
      log.level: debug
      registries.conf: |
        registries:
        - name: acrexample
          api_url: https://acrexample.azurecr.io/
          prefix: acrexample.azurecr.io
          ping: yes
          insecure: no
          credentials: ext:/app/scripts/acr-login.sh
          credsexpire: 10h
    ---
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: argocd-image-updater-config-acr
      namespace: argocd
    data:
      acr-login.sh: |
        #!/bin/sh
        LOGIN=$(az login --identity)
        REGISTRY="acrexample"
        TOKEN=$(az acr login --name $REGISTRY --expose-token --output tsv --query accessToken)
        echo "00000000-0000-0000-0000-000000000000:$TOKEN"
    ```
    
    Closes argoproj-labs#550 and argoproj-labs#473
    
    Signed-off-by: Francesc Arbona <francesc.arbona@global.ntt>
    xescab committed Sep 8, 2023
    Configuration menu
    Copy the full SHA
    41bc3c8 View commit details
    Browse the repository at this point in the history
  2. fix: Allow enough time for az acr login to complete

    Signed-off-by: Francesc Arbona <francesc.arbona@global.ntt>
    xescab committed Sep 8, 2023
    Configuration menu
    Copy the full SHA
    b734c41 View commit details
    Browse the repository at this point in the history
  3. docs: Explain how to configure the script and the registry for ACR

    Signed-off-by: Francesc Arbona <francesc.arbona@global.ntt>
    xescab committed Sep 8, 2023
    Configuration menu
    Copy the full SHA
    76d4c94 View commit details
    Browse the repository at this point in the history
  4. fix: Use correct ref in v1alpha1.Application test

    Signed-off-by: Francesc Arbona <francesc.arbona@global.ntt>
    xescab committed Sep 8, 2023
    Configuration menu
    Copy the full SHA
    15de0f1 View commit details
    Browse the repository at this point in the history