argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.87k stars 5.45k forks source link

Argo-CD SYNC in one directory, shows message of another directory in UI #8196

Open abhinayguptapeoplegrove opened 2 years ago

abhinayguptapeoplegrove commented 2 years ago

We have deployed two components [A, B] in ArgoCD whose helms structure are show below

.
├── helm-deployments
│   ├── component-A
│   │   ├── Chart.yaml
│   │   ├── templates
│   │   │   ├── NOTES.txt
│   │   │   ├── _helpers.tpl
│   │   │   ├── service.yaml
│   │   │   └── serviceaccount.yaml
│   │   ├── values.yaml
│   ├── component-B
│   │   ├── Chart.yaml
│   │   ├── templates
│   │   │   ├── NOTES.txt
│   │   │   ├── _helpers.tpl
│   │   │   ├── serviceaccount.yaml
│   │   ├── values.yaml

ArgoCD application yaml COMPONENT-A

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: component-A
  namespace: argocd
  annotations:
spec:
  project: dev
  source:
    repoURL: 'git@github.com:******.******.git
    path: helm-deployments/component-A/
    targetRevision: ***
    helm:
      valueFiles:
        - values.yaml
  destination:
    server: 'https://**.**.**'
    namespace: default
  syncPolicy:
    automated:
      selfHeal: true
  revisionHistoryLimit: 10

COMPONENT-B

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: component-B
  namespace: argocd
  annotations:
    argocd.argoproj.io/manifest-generate-paths: .
spec:
  project: dev
  source:
    repoURL: 'git@github.com:*********/***.git'
    path: helm-deployments/component-B/
    targetRevision: ***
    helm:
      valueFiles:
        - values.yaml
  destination:
    server: 'https://**.**.**
    namespace: default
  syncPolicy:
    automated:
      selfHeal: true
  revisionHistoryLimit: 5

Checklist:

Describe the bug

Sometimes when there is commit in values.yaml in component A, ArgoCD application of component B starting syncing which is weird

To Reproduce

Not reproducible

Expected behaviour

Syncing of both ArgoCD applications [component A and B] should works independently

Screenshots

If applicable, add screenshots to help explain your problem.

ArgoCD Version

V2.1.7

Logs

NO LOGS
jannfis commented 2 years ago

The manifest path generation annotations only work for webhooks. Because it only happens "sometimes", maybe the app refresh interval triggers the reconciliation of Component-B, because the target revision (they are redacted above, but I suspect they both point to the same) resolves to a new commit SHA?

psanzm commented 2 years ago

We are facing the same problem. We have a mono-repo and we configured webhooks in Github to trigger the resync but when an application is refreshed, we can see other applications totally unrelated and located in different paths being synchronized too.

This is an example of one commit modifying one application:

Captura de pantalla 2022-01-17 a las 12 38 34

And all the application's charts (we have helm charts + chartmusseum) are downloaded again and we can see the request from argocd-repo-server pod in the chartmusseum logs.

heesuk-ahn commented 2 years ago

I am also having a similar problem. 🤔

Multiple applications are used in monorepo, and when one application is deployed, other applications (different directories) that are completely unrelated are also distributed.

Since we are currently using the bitbucket server, we can't even use the manifest path generation annotation.

matiasbackbase commented 1 year ago

Does anyone have any update on this? I'm also having this same problem.

oleksandrsemak commented 1 month ago

I see that application become out of sync when targetRevision is branch and new commit change sha of the branch and trigger sync on not related resources