kapp-controller icon indicating copy to clipboard operation
kapp-controller copied to clipboard

Duplicate Secret Error when Fetching Multiple Private Git Repos with Same Secret

Open doddatpivotal opened this issue 2 years ago • 4 comments

What steps did you take: I have an App that fetches two private git repos. They both use the same secret for auth.

...
  fetch:
  - git:
      url: https://dev.azure.com/example/tap-lab/_git/gitops-platform
      ref: origin/1.4
      path:  clusters/full/app-contents/desired-namespaces
      secretRef:
        name: git-creds-carvel
  - git:
      url: https://dev.azure.com/example/tap-lab/_git/gitops-platform
      ref: origin/1.4
      path:  clusters/full/app-contents/desired-namespaces2
      secretRef:
        name: git-creds-carvel
....

What happened: I get a reconcilation error Useful Error Message: vendir: Error: Syncing directory '0': │ Syncing directory '.' with git contents: │ Fetching git repository: │ Expected to find one secret 'git-creds-carvel', but found multiple

Environment:

  • kapp Controller version (execute kubectl get deployment -n kapp-controller kapp-controller -o yaml and the annotation is kbld.k14s.io/images): v0.38.4
  • Kubernetes version (use kubectl version): v1.23

doddatpivotal avatar Dec 03 '22 16:12 doddatpivotal

Hi @doddatpivotal ! Thank you helping make kapp-controller better by finding this.

Our next steps as a team are to reproduce this bug and then to fix it, given the teams current priorities this might not happen for a while. We would love a contribution if you feel like you could do that, we can help guide you if you do opt for making a pull request.

Thanks!

neil-hickey avatar Dec 22 '22 18:12 neil-hickey

This has been fixed in vendir some time ago. Can we bump vendir dependency in kapp-controller?

jorgemoralespou avatar Jul 03 '23 08:07 jorgemoralespou

@jorgemoralespou This was fixed in vendir v0.34.0 which is being used in the latest kapp-controller release (v0.46.x). Would you be able to try it out and let us know if you are still facing the issue?

praveenrewar avatar Jul 10 '23 10:07 praveenrewar

@praveenrewar I was confused by this (https://github.com/carvel-dev/kapp-controller/blob/v0.46.1/go.mod#L12). I'll try it tomorrow to see if latest works.

jorgemoralespou avatar Jul 12 '23 04:07 jorgemoralespou