Skip to content

Docs example for distributed repos #264

@rklonner

Description

@rklonner

The FAQs say

Does it work with a distributed Argo CD repository setup?
Short answer: Maybe... It depends on what you are trying to achieve.

Longer answer: The tool is not specifically designed to work with a distributed Argo CD repository setup, where applications and their manifests are spread across multiple repositories.

Do you mean by a "distributed Argo CD repository setup" that ArgoCD application manifests and k8s application manifests are separated in different repositories?

Because that was my initial use case when I tried the tool. In this case I have shared responsibilities, k8s manifests are in developer responsibility, ArgoCD manifests in platform engineer responsibility. Therefore each kind of manifests are in different repos. I wanted to give both parties the opportunity to use ArgoCD Diff Preview in PRs.

It took me some time to realize that for the developer use case I can accomplish that if I clone two times the main branch of the ArgoCD application manifests (constant, no change) and then mention the repo of the k8s manifests and its branch during execution of argocd-diff-preview.

If that kind of workflow was the intention in your FAQ entry I would like to add a general example to showcase this, I tried that here with my example repos:

# checkout 2 times the same state of ArgoCD manifests (leave branch constant at main)
git clone https://github.com/rklonner/argocd-example-guestbook.git base-branch --depth 1 -q
git clone https://github.com/rklonner/argocd-example-guestbook.git target-branch --depth 1 -q

# checkout the k8s manifest to diff on from a different repo -> rklonner/argocd-example-apps
docker run
 --network host
-v /var/run/docker.sock:/var/run/docker.sock
-v $(pwd)/output:/output
-v $(pwd)/base-branch:/base-branch 
-v $(pwd)/target-branch:/target-branch
-e TARGET_BRANCH=test-argocd-diff
-e REPO=rklonner/argocd-example-apps
dagandersen/argocd-diff-preview:v0.1.19

Combined with an illustration incl. commands like mentioned here this could make it more clear for others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions