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

Using the same repo in multi-source application feature

Open ShirMonDT opened this issue 2 years ago • 11 comments

Summary

In the 2.6 multiple source application feature I would like to use the same git repository with different refs but I'm getting the following error; rpc error: code = Unknown desc = cannot reference a different revision of the same repository image

I understand that under the hood, we’re dealing with a single copy of the cloned repo. To reference one revision, we have to checkout that revision and then acquire a lock. If we try to reference another revision at the same time, we hit a potential deadlock.

Motivation

I would like to use different refs from the same repository in the same application. This will allow usage of git tags to version certain generic configurations and referencing them in the same repository. So for example if I have a GitOps repository with helm charts I would like to version them with git tags and reference the relevant chart version with up to date values.

Proposal

One solution would be to make a temporary copy of the referenced repo, or at least the referenced file.

ShirMonDT avatar Jan 26 '23 17:01 ShirMonDT

We are also missing this functionality. Our use case is that we want to use a Helm Chart as the first source from a feature branch and the values for the Chart from the main branch of the same repository. Do you consider the implementation of this feature to be very complex? We think about contributing this if there are no plans from your side to work on this in the near future. Do you think in general this feature would be reasonable to implement and are you open to incorporate a contribution of ours? @crenshaw-dev

marianheinsen avatar Mar 30 '23 07:03 marianheinsen

Do you consider the implementation of this feature to be very complex?

Not too bad, no.

if there are no plans from your side to work on this in the near future

Unfortunately I won't be able to get to it any time soon.

Do you think in general this feature would be reasonable to implement and are you open to incorporate a contribution of ours?

I think it's reasonable and would absolutely review it!

The reason it's not supported now is that we lock and then check out each repo exactly once.

In the case of multiple revisions, we'd need to lock and check out one revision, copy the target values file somewhere safe (random UUID path to protect it from path traversal attacks), and then unlock the repo. Of course, you'll have to clean up the copied values file after using it.

crenshaw-dev avatar Mar 30 '23 13:03 crenshaw-dev

@crenshaw-dev I would be thrilled to see this feature implemented as well! Being able to manage our Helm chart versioning in this manner would be a significant improvement for our workflows. @marianheinsen If you are considering implementing this feature, please keep us posted. I am sure many of us would be eager to offer assistance and support if needed. Looking forward to seeing your contribution!

natalicot avatar Apr 17 '23 13:04 natalicot

We would be glad to see this too!

tkaesserfm avatar May 04 '23 12:05 tkaesserfm

Also looking forward seeing this feature soon. We use multiple values files in the same repo, while one of the files should always be taken of the main branch even when the chart is deployed from a feature branch. We'd love having this implemented soon in order to use ArgoCD with our use case.

amiros89 avatar Oct 04 '23 18:10 amiros89

We have a very similar predicament to @amiros89 - we would like valuesfiles from the main branch and a particular git ref for the applcation

SKY-Mark-Rhoades-Brown avatar Nov 14 '23 15:11 SKY-Mark-Rhoades-Brown

I agree, it would be extremely convenient in my case. I'm waiting for implementation

Nilushka avatar Dec 15 '23 08:12 Nilushka

My temporarty solution - is ArgoCD deception. Make a second DNS publication

  # master config
  - path: '{{path}}'
    repoURL: 'https://gitlab-mirror.domain.com/deploy/{{project}}.git'
    targetRevision: 'master'
    ref: masterConfig

  # env config
  - path: '{{path}}'
    repoURL: 'https://gitlab.domain.com/deploy/{{project}}.git'
    targetRevision: '{{branch}}'
    ref: envConfig

Nilushka avatar Feb 13 '24 14:02 Nilushka

Any update on this feature ?

medykn-git avatar Apr 18 '24 08:04 medykn-git

+1

vuthongkms avatar May 08 '24 19:05 vuthongkms

+1

jakuboskera avatar May 24 '24 09:05 jakuboskera

My temporary solution is also using different value for repoRUL so for Helm Chart I use protocol SSH and for values HTTPS protocol. Not ideal but works without so much pain.

jakuboskera avatar Jun 03 '24 20:06 jakuboskera

+1

marpears avatar Aug 30 '24 16:08 marpears