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 #609

Closed
wants to merge 19 commits into from

Conversation

jwhy89
Copy link

@jwhy89 jwhy89 commented Aug 17, 2023

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:

registries:
- name: ACR example with external script
  api_url: https://acr-example.azurecr.io/
  prefix: acr-example.azurecr.io
  credentials: ext:/app/scripts/acr-login.sh
  credsexpire: 10h

The script should contain the name of the registry:

  acr-login.sh: |
    #!/bin/sh
    LOGIN=$(az login --identity)
    REGISTRY="acr-example"
    TOKEN=$(az acr login --name $REGISTRY --expose-token --output tsv --query accessToken)
    echo "00000000-0000-0000-0000-000000000000:$TOKEN"

Closes #550 #473 and #586

xescab and others added 18 commits August 17, 2023 12:18
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: Jarvis Yang <jarvis.yang@recurohealth.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
Signed-off-by: Daniel Mavis <daniel.mavis@faa.gov>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
…ns (argoproj-labs#584)

Signed-off-by: Daniel Mavis <daniel.mavis@faa.gov>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
Co-authored-by: Abdellah Derfoufi <mohammed-abdellah.derfoufi@capgemini.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
Signed-off-by: satoru <satorulogic@gmail.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
Signed-off-by: satoru <satorulogic@gmail.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
* ci: Fix codegen

Signed-off-by: jannfis <jann@mistrust.net>

* Fix tar call

Signed-off-by: jannfis <jann@mistrust.net>

---------

Signed-off-by: jannfis <jann@mistrust.net>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
…roj-labs#573)

* Fix original override not respected

Signed-off-by: KS. Yim <ks.yim@linecorp.com>

* Add writeOverrides unittest

Signed-off-by: KS. Yim <ks.yim@linecorp.com>

* Add helm override commit test

Signed-off-by: KS. Yim <ks.yim@linecorp.com>

* lint

Signed-off-by: KS. Yim <ks.yim@linecorp.com>

* fix shadowed err

Signed-off-by: KS. Yim <ks.yim@linecorp.com>

---------

Signed-off-by: KS. Yim <ks.yim@linecorp.com>
Co-authored-by: KS. Yim <ks.yim@linecorp.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
…rgoproj-labs#594)

* fix: update go mods to use newer argocd app definition

Signed-off-by: Jesse Bye <8467862+jessebye@users.noreply.github.com>

* fix deps and tests

Signed-off-by: Jesse Bye <8467862+jessebye@users.noreply.github.com>

* fix spelling

Signed-off-by: Jesse Bye <8467862+jessebye@users.noreply.github.com>

---------

Signed-off-by: Jesse Bye <8467862+jessebye@users.noreply.github.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
…abs#599)

Signed-off-by: Viacheslav Sychov <viacheslav.sychov@gmail.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
…labs#600)

makes argocd-image-updater compatible with restricted Pod Security Standard

Signed-off-by: Takeo Sawada <myc.monad@gmail.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
…ion (argoproj-labs#424)

* Add possibility to specify write-back GIT repository as annotation.

Signed-off-by: flozzone <flozzone@gmail.com>

* Update golangci-lint to 1.52.2.

Signed-off-by: flozzone <flozzone@gmail.com>

* Replace deprecated golangci linters with 'unused' linter.

Signed-off-by: flozzone <flozzone@gmail.com>

* Fix Goimport issues.

Signed-off-by: flozzone <flozzone@gmail.com>

---------

Signed-off-by: flozzone <flozzone@gmail.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
Signed-off-by: Jarvis Yang <jarvis.yang@recurohealth.com>
@jwhy89
Copy link
Author

jwhy89 commented Aug 21, 2023

@jannfis I don't know where @xesceb went but here's the updated PR with DCO.

@jwhy89
Copy link
Author

jwhy89 commented Sep 11, 2023

Closed by #586

@jwhy89 jwhy89 closed this Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot pull images from Azure Container Registry