Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

out of sync applications ignore manifest-paths annotation #19967

Open
3 tasks done
bobzoller opened this issue Sep 17, 2024 · 1 comment
Open
3 tasks done

out of sync applications ignore manifest-paths annotation #19967

bobzoller opened this issue Sep 17, 2024 · 1 comment

Comments

@bobzoller
Copy link

bobzoller commented Sep 17, 2024

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

When an application is a) out of sync and b) uses the manifest-paths annotation, it will attempt a sync for every new repo revision, not only those whose content matches its manifest-paths.

To Reproduce

  1. create an Application that uses manifest-paths:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  annotations:
    argocd.argoproj.io/manifest-generate-paths: .
  name: infra-development-tester-development
spec:
  destination:
    name: development
    namespace: infra-development-tester
  project: default
  source:
    directory:
      recurse: true
    path: development/infra-development-tester
    repoURL: git@github.com:example/deployments.git
  syncPolicy:
    automated:
      allowEmpty: true
      prune: true
    retry: {}
  1. create a commit that adds a manifest at development/infra-development-tester/manifest.yaml that succeeds but does not match, thereby leaving the application Out of Sync (Not sure how to give you a reproducible test case for Out of Sync... in our case a custom operator was swallowing a particular field of the resource definition. Make sure the Application uses the manifest-paths annotation.)

  2. create another commit in a different directory of the deployments repo.

  3. watch the app attempt a sync. (it shouldn't)

  4. create another commit that fixes the out of sync error in the manifest; watch it sync successfully

  5. create another commit in an unrelated directory; watch it ignore that revision and skip the sync!

Expected behavior

That the application only attempts a sync when there's a new revision and it matches its manifest-paths annotation.

Screenshots

none

Version

{
    "Version": "v2.11.7+e4a0246",
    "BuildDate": "2024-07-24T09:33:49Z",
    "GitCommit": "e4a0246c4d920bc1e5ee5f9048a99eca7e1d53cb",
    "GitTreeState": "clean",
    "GoVersion": "go1.21.10",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.2.1 2023-10-19T20:13:51Z",
    "HelmVersion": "v3.14.4+g81c902a",
    "KubectlVersion": "v0.26.11",
    "JsonnetVersion": "v0.20.0"
}

Logs

Paste any relevant application logs here.
@CefBoud
Copy link
Contributor

CefBoud commented Sep 22, 2024

@bobzoller Thank you for the detailed issue report.

My theory is that the sync in step 4 is unrelated to the commit in step 3. Once the application falls out of sync in step 2, it attempts reconciliation at each timeout.reconciliation interval (default: 3 minutes), regardless of any subsequent commits.

This can be confirmed if a sync attempt occurs before creating the commit in step 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants