argo-cd icon indicating copy to clipboard operation
argo-cd copied to clipboard

Mulitsource not working with private git repo

Open karthik1710 opened this issue 1 year ago • 1 comments

Discussed in https://github.com/argoproj/argo-cd/discussions/16746

Originally posted by karthik1710 January 4, 2024 Hi All,

I'm trying deploy a helm chart with custom values ref: from private git repo. Both helm chart and git repo are private and repositories are already added in argocd.

Below is my argocd setup,

argocd: v2.9.3+6eba5be
  BuildDate: 2023-12-01T23:24:09Z
  GitCommit: 6eba5be864b7e031871ed7698f5233336dfe75c7
  GitTreeState: clean
  GoVersion: go1.21.4
  Compiler: gc
  Platform: linux/amd64
argocd-server: v2.9.3+6eba5be
  BuildDate: 2023-12-01T23:05:50Z
  GitCommit: 6eba5be864b7e031871ed7698f5233336dfe75c7
  GitTreeState: clean
  GoVersion: go1.21.3
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v5.2.1 2023-10-19T20:13:51Z
  Helm Version: v3.13.2+g2a2fb3b
  Kubectl Version: v0.24.2
  Jsonnet Version: v0.20.0

My application.yaml

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: fr-eb-mongodb-dev
spec:
  destination:
    name: ''
    namespace: fr-mongodb-dev
    server: 'https://kubernetes.default.svc'
  sources:
  - repoURL: 'https://gitlab.com/api/v4/projects/xxxx/packages/helm/stable'
    chart: mongodb
    targetRevision: 1.0.0
    helm:
      valueFiles:
      - $values/custom-value/values-fr.yaml
  - repoURL: 'https://gitlab.com/xxxx/eb-xxxx/exxx.git'
    targetRevision: custom-values
    ref: values
  project: default
  syncPolicy:
    automated:
      prune: false
      selfHeal: false

In the application.yaml, I trying to deploy private helm chart with custom values from git repository. But after deployment I could see Argocd is not getting custom values from the referred repo.

Thanks in advance. :raised_hands:

karthik1710 avatar Jan 04 '24 11:01 karthik1710

@ishitasequeira Can you help me in this? Thanks

karthik1710 avatar Jan 04 '24 12:01 karthik1710

I can confirm the issue. Just happening for a multi-sources app, and on different argocd versions: v2.9.3 and v2.8.5. Also happens with the repository and credentials template. How should we proceed with this issue?

Exact error: Failed to load target state: failed to generate manifest for source 1 of 2: rpc error: code = Unknown desc = failed to get git client for repo https://github.com/xxx-org/gitops-repo'

stepa-ict avatar Jan 10 '24 11:01 stepa-ict

Also, we've tried to downgrade argocd to v2.7.8 and use ssh auth method, but no luck. Still getting the same issue. image

stepa-ict avatar Jan 10 '24 12:01 stepa-ict

Thanks @karthik1710 and @stepa-ict for raising the issue. I will try reproducing the issue on my end.

ishitasequeira avatar Jan 10 '24 19:01 ishitasequeira

@ishitasequeira Do you have any info regarding this issue? It becomes very important. We've switched completely to multi-source apps, so this is a huge problem. Thanks for understanding. If we can help anyhow, please let us know.

stepa-ict avatar Jan 19 '24 10:01 stepa-ict

Apologies for a delayed response. I tried reproducing the issue, and was able to see an error when used chart field. Try using path field instead. Below example worked for me and should resolve the issue you are seeing.

sources:
  - repoURL: '[email protected]:ishitasequeira/multi-source-test.git'
    path: helm-guestbook
    targetRevision: main
    helm:
      valueFiles:
        - $values/values-guestbook.yaml
  - repoURL: '[email protected]:ishitasequeira/multi-source-values.git'
    targetRevision: main
    ref: values

ishitasequeira avatar Feb 06 '24 03:02 ishitasequeira

@karthik1710 @stepa-ict , did the above solution work for you?

ishitasequeira avatar Feb 20 '24 21:02 ishitasequeira

Closing the issue considering the suggestion above has resolved the issue. Please feel free to re-open the issue if you continue facing the same error.

ishitasequeira avatar Mar 17 '24 21:03 ishitasequeira