argoproj / argo-cd

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

The automatic synchronization cannot be stopped and disable #13329

Closed helloworld113 closed 1 year ago

helloworld113 commented 1 year ago

Checklist:

Describe the bug

this is my busybox app

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: busybox-deployment
  namespace: argocd
  ownerReferences:
  - apiVersion: argoproj.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: ApplicationSet
    name: xx
    uid: 62a2ddb9-c2d4-4383-b0b0-521d67d1e796
  resourceVersion: "33875954"
  uid: 9902f56c-76ea-46ca-9456-60ae5cbcb6c1
spec:
  destination:
    namespace: applicationset
    server: https://10.XX2:6443
  project: xx
  source:
    path: applicationset/XX/busybox-deployment
    repoURL:XX.git
    targetRevision: HEAD
  syncPolicy:
    automated: {}

my syncPolicy settings is :

  syncPolicy:
    automated: {}

now I try use kubectl edit Application busybox-deployment edit syncPolicy to disable auto-sync:

syncPolicy: {}

but when i save quit the vi editor, the save is recovey to automated. the save step does't have error info. also i try to disable auto-sync by web SYNC POLICY it not work too. i am try to stop some app to dis auto-sync in sometime, is anybody can help me. thanks a lot!

this is the ApplicationSet.

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: xx
  namespace: argocd
spec:
  generators:
    - matrix:
        generators:
          - git:
              directories:
                - path: applicationset/xx/*
                - exclude: true
                  path: donotdeploy
              repoURL: 'xx.git'
              revision: HEAD
          - clusters:
              selector:
                matchLabels:
                  name: xx
  syncPolicy:
    preserveResourcesOnDeletion: true
  template:
    metadata:
      name: '{{path.basename}}'
    spec:
      destination:
        namespace: '{{path[0]}}'
        server: '{{server}}'
      project: watch-tcx
      source:
        path: '{{path}}'
        repoURL: 'xx.git'
        targetRevision: HEAD
      syncPolicy:
        automated:
          prune: false
          selfHeal: false

Version

{
    "Version": "v2.6.0+acc554f",
    "BuildDate": "2023-02-06T21:17:26Z",
    "GitCommit": "acc554f3d99010e0353b498a595844b30090556f",
    "GitTreeState": "clean",
    "GoVersion": "go1.18.10",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v4.5.7 2022-08-02T16:35:54Z",
    "HelmVersion": "v3.10.3+g835b733",
    "KubectlVersion": "v0.24.2",
    "JsonnetVersion": "v0.19.1"
}
helloworld113 commented 1 year ago

I have already deployed it in a production environment. I would greatly appreciate it if someone could help me.

ebuildy commented 1 year ago

This is because the argocd parent app has "auto-sync" and so on.

Think about a "auto-sync chain", you must disable auto-sync from the "root" application til the child application, else argocd will do his job by cancelling your manual modification.

helloworld113 commented 1 year ago

This is because the argocd parent app has "auto-sync" and so on.

Think about a "auto-sync chain", you must disable auto-sync from the "root" application til the child application, else argocd will do his job by cancelling your manual modification.

thanks, when i close ApplicationSet's auto-sync and the apps's auto-sync is close too. it seems work well now.