carvel-dev / kapp-controller

Continuous delivery and package management for Kubernetes.
https://carvel.dev/kapp-controller
Apache License 2.0
260 stars 99 forks source link

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

Open doddatpivotal opened 1 year ago

doddatpivotal commented 1 year ago

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:

neil-hickey commented 1 year ago

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!

jorgemoralespou commented 1 year ago

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

praveenrewar commented 12 months ago

@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?

jorgemoralespou commented 12 months ago

@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.