Skip to content

Registry login error with helm OCI private dependencies #8563

@jerousseau

Description

@jerousseau

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug
Similar issue to this comment : #8266 (comment)

When setting credentials templates that match a registry but that are not given as a repository (repocreds instead), the login fails because Argo CD passes the schema oci:// as the registry URL, but helm (using oras-go) will fail because it does not support the oci:// schema, and so login command will fail

To Reproduce

  1. Create an ArgoCD helm OCI repo-creds secret
apiVersion: v1
kind: Secret
metadata:
  name: argoproj-gitlab-helm-creds
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repo-creds
stringData:
  url: registry.gitlab.com/test
  enableOCI: true
  type: helm
  password: my-password
  username: my-username
  1. Use a chart with a dependencie that match the repo-creds url
apiVersion: v2
name: test-chart
version: 1.0.0
dependencies:
- name: toto-spa
  version: 1.1.1
  repository: "oci://registry.gitlab.com/test/toto"
  1. ArgoCD will try to login with oci scheme in url
helm registry login oci://registry.gitlab.com/test/toto --username ****** --password ******

Expected behavior
helm registry login without oci scheme in url

helm registry login registry.gitlab.com/test/toto --username ****** --password ******

Version

argocd: v2.2.5+8f981cc
  BuildDate: 2022-02-05T01:33:25Z
  GitCommit: 8f981ccfcf942a9eb00bc466649f8499ba0455f5
  GitTreeState: clean
  GoVersion: go1.16.11
  Compiler: gc
  Platform: linux/amd64``

Logs

rpc error: code = Unknown desc = `helm registry login oci://registry.gitlab.com/test/toto --username ****** --password ******` failed exit status 1: WARNING: Using --password ****** the CLI is insecure. Use --password-stdin. time="2022-02-18T11:02:49Z" level=info msg="Error logging in to v2 endpoint, trying next endpoint: Get \"https://oci/v2/\": dial tcp: lookup oci on 10.32.0.10:53: no such host" Error: Get "https://oci/v2/": dial tcp: lookup oci on 10.32.0.10:53: no such host

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions