argo-cd
argo-cd copied to clipboard
Using the same repo in multi-source application feature
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
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.
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
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 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!
We would be glad to see this too!
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.
We have a very similar predicament to @amiros89 - we would like valuesfiles from the main branch and a particular git ref for the applcation
I agree, it would be extremely convenient in my case. I'm waiting for implementation
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
Any update on this feature ?
+1
+1
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.
+1