argo-cd: helm dependency build is failing with subchart

Error

rpc error: code = Unknown desc = `sh -c helm dependency build` failed exit status 1: Error: no cached repository for helm-manager-ebe10bb4e257360e3453a37c457759ba554bc3a2fd86e79d6f93e4d119b0e1e2 found. (try 'helm repo update'): open /home/argocd/.cache/helm/repository/helm-manager-ebe10bb4e257360e3453a37c457759ba554bc3a2fd86e79d6f93e4d119b0e1e2-index.yaml: no such file or directory

Chart.yaml

apiVersion: v2
name: cert-manager
version: 0.0.1
dependencies:
- name: cert-manager
  version: v1.4.0
  repository: https://charts.jetstack.io

Plugin

  configManagementPlugins: |-
    - name: argocd-vault-plugin-helm
      init:
        command: ["sh", "-c"]
        args: ["helm dependency build"]
      generate:
        command: ["sh", "-c"]
        args: ["helm template ${helm_args} . > all.yaml && argocd-vault-plugin generate all.yaml"]

Versions

argocd@argocd-server-7d859b554f-kl9m4:~$ helm version
version.BuildInfo{Version:"v3.6.0", GitCommit:"7f2df6467771a75f5646b7f12afb408590ed1755", GitTreeState:"clean", GoVersion:"go1.16.3"}
argocd@argocd-server-7d859b554f-kl9m4:~$ argocd version
argocd: v2.1.1+aab9542
  BuildDate: 2021-08-25T15:12:04Z
  GitCommit: aab9542f8b3354f0940945c4295b67622f0af296
  GitTreeState: clean
  GoVersion: go1.16.5
  Compiler: gc
  Platform: linux/amd64
FATA[0000] Argo CD server address unspecified

https://www.gitmemory.com/issue/unbroken-dome/gradle-helm-plugin/102/850499759

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 33 (27 by maintainers)

Commits related to this issue

Most upvoted comments

Please review https://github.com/argoproj/argo-cd/pull/7162

To me this works like a charm.

Waiting for the approval, you can also use the following kustomize patch:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: argocd-repo-server
spec:
  template:
    spec:
      volumes:
      - name: helm-working-dir
        emptyDir: {}
      containers:
      - name: argocd-repo-server
        volumeMounts:
        - mountPath: /helm-working-dir
          name: helm-working-dir
        env:
        - name: HELM_CACHE_HOME
          value: /helm-working-dir
        - name: HELM_CONFIG_HOME
          value: /helm-working-dir
        - name: HELM_DATA_HOME
          value: /helm-working-dir
        


@rwong2888 I did not use argocd-vault-plugin. In my plugin, I used below to test if plugin can resolve dependencies.

    - name: argocd-vault-plugin-helm
      init:
        command: ["sh", "-c"]
        args: ["helm repo add ${helm_dependency_name} ${helm_dependency_repo} --debug && helm dependency build"]
      generate:
        command: ["sh", "-c"]
        args: ["helm template ."]