Open sadovnikov opened 4 years ago
Hi @sadovnikov, I couldn't reproduce this issue, but maybe I did the wrong steps to reproduce it. I did the following:
I created a repo containing a single application.yaml
with the following contents:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: test-app
namespace: argocd
spec:
destination:
namespace: test
server: https://kubernetes.default.svc
project: default
source:
path: kustomize-guestbook
repoURL: https://github.com/jannfis/argocd-example-apps
targetRevision: HEAD
syncPolicy:
automated: {}
I then created an application parent
using ArgoCD UI, and specifying above mentioned repo as its source. This creates the app-of-apps pattern, with parent
as parent and test-app
as child. parent
has no automatic sync policy.
Once I sync parent
, test-app
resource is created and immediately syncs due to automatic sync policy
I changed sync policy of test-app
to syncPolicy: {}
and commited to repository
After a refresh, parent
becomes out of sync
Once I sync parent
, it reconciles the updated manifest for test-app
and I can see that automatic sync policy for test-app
is disabled
Did I miss something?
Hi @jannfis, I created https://github.com/sadovnikov/argocd-tests/tree/master/github-3895 to reproduce the bug, but it's not reproducible anymore. Neither I can reproduce it with the original repositories ;( I'll re-open the issue if I find a way to reproduce it. Thank you!
Hi everyone, I'm facing the same issue, It start when i tried to run a rollback from the UI and got the following error :
Then, i chose one of the old deployment to rollback, got prompt if i want to disable the auto-sync, clicked yes and got the following error :
When trying to disable the auto-sync from the UI OR from the cli, nothing really happen.
{
"Version": "v2.0.3+8d2b13d",
"BuildDate": "2021-05-27T17:38:37Z",
"GitCommit": "8d2b13d733e1dff7d1ad2c110ed31be4804406e2",
"GitTreeState": "clean",
"GoVersion": "go1.16",
"Compiler": "gc",
"Platform": "linux/amd64",
"KsonnetVersion": "v0.13.1",
"KustomizeVersion": "v3.9.4 2021-02-09T19:22:10Z",
"HelmVersion": "v3.5.1+g32c2223",
"KubectlVersion": "v0.20.4",
"JsonnetVersion": "v0.17.0"
}
@sadovnikov Would you mind to re-open this issue ?
kubectl -n <namespace> patch --type='merge' application <app-name> -p "{\"spec\":{\"syncPolicy\":null}}"
I'm having this problem too.
I'm trying it from the UI (buttons), modifying the manifest, the kubectl patch does not work either.
I'm under the impression that this is something intermittent. I think it was working a day or two ago, but now it's not.
Here is my server version
{ "Version": "v2.0.4+0842d44", "BuildDate": "2021-06-23T01:27:53Z", "GitCommit": "0842d448107eb1397b251e63ec4d4bc1b4efdd6e", "GitTreeState": "clean", "GoVersion": "go1.16", "Compiler": "gc", "Platform": "linux/amd64", "KsonnetVersion": "v0.13.1", "KustomizeVersion": "v3.9.4 2021-02-09T19:22:10Z", "HelmVersion": "v3.5.1+g32c2223", "KubectlVersion": "v0.20.4", "JsonnetVersion": "v0.17.0" }
Created ticket to improve auto-sync button behavior: https://github.com/argoproj/argo-cd/issues/7197
is there any update about this bug?
We are also experiencing this issue, what is the current status on this?
Re-opening this as people reporting issue again.
Any news?
I'm experiencing the same issue.
To disable the sync in the YAML manifest I set syncPolicy: {}
but I would like to keep the syncOption
, and today is impossible to have both.
syncPolicy:
syncOptions:
- FailOnSharedResource=true
I'm facing the similar problem that I cannot disable auto-snyc (nor pruning and self heal) of an application resource via the UI. It seems to me that argoCD is overwriting these changes immediately as it tries to sync and auto-heal again - which Im trying to disable! So the UI buttons must get around the self-healing and auto-syncing process to be able to work...
Update: For my problem (and i figure it might resolve the OPs problem as well) the issue was that in my app-of-apps pattern, the root-application was configured with self-heal=true
, causing changes to the child-apps to be "healed" even though the child apps had a different (or no) sync-policy configured.
So now my setup is: root-app: syncPolicy: automated # so new apps are auto-detected and deployed
prune: true # so removed apps get deleted
and selfHeal: false # so changes to child-apps (e.g. via the UI) do not trigger an auto sync
I hope this helps someone out there as well!
I want to override sync policy from CLI and I also fail miserably. I tried the approach proposed by @adrian-sturm, but with no result. I tried disabling syncing at all, also with no result. From UI the situation is the same. Additionally, I don't get any error messages, argo just keeps bringing back the original configuration.
Parent application yaml and original status:
destination:
namespace: krowa
server: https://kubernetes.default.svc
project: default
source:
helm:
valueFiles:
- environments/dev.yaml
path: argocd/krowa-apps
repoURL: <redacted>
targetRevision: HEAD
syncPolicy:
automated:
prune: true
selfHeal: true
$ argocd app get krowa-parent
Name: argo/krowa-parent
Project: default
Server: https://kubernetes.default.svc
Namespace: krowa
URL: <redacted>
Repo: <redacted>
Target: HEAD
Path: argocd/krowa-apps
Helm Values: environments/dev.yaml
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: Synced to HEAD (5519559)
Health Status: Healthy
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
Namespace krowa krowa Succeeded Synced namespace/krowa unchanged
argoproj.io Application argo child-app Synced application.argoproj.io/child-app configured
Namespace krowa Synced
I edited parent app and I commented out whole syncPolicy
section:
$ argocd app edit krowa-parent
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures."
destination:
namespace: krowa
server: https://kubernetes.default.svc
project: default
source:
helm:
valueFiles:
- environments/dev.yaml
path: argocd/krowa-apps
repoURL: <redacted>
targetRevision: HEAD
# syncPolicy:
# automated:
# prune: true
# selfHeal: true
Check app once again
$ argocd app get krowa-parent
Name: argo/krowa-parent
Project: default
Server: https://kubernetes.default.svc
Namespace: krowa
URL: <redacted>
Repo: <redacted>
Target: HEAD
Path: argocd/krowa-apps
Helm Values: environments/dev.yaml
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: Synced to HEAD (5519559)
Health Status: Healthy
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
Namespace krowa krowa Succeeded Synced namespace/krowa unchanged
argoproj.io Application argo child-app Synced application.argoproj.io/child-app configured
Namespace krowa Synced
Running argocd app set krowa-parent --sync-policy="none"
has no effect.
Changes in UI are also immediately brought back to the original settings.
Argo CD Server version
{
"Version": "v2.6.3+e05298b",
"BuildDate": "2023-02-27T14:40:19Z",
"GitCommit": "e05298b9c6ab8610104271fa8491f019fee3c587",
"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"
}
I'd really appreciate some help :)
@olastefaniak I assume you are using the app-of-apps pattern as well and "krowa-parent" is the root application resource? Commenting out the sync policy likely results in argocd using the default sync policy, which I could not find in the docs but by the behavior you describe it might be "automated" anyways. As long as "self-heal" is activated in the deployed resource (aka the yaml found in your k8s cluster), argocd will continue to overwrite any changes with the status described in your repository.
Have you tried disabling "self-heal" in your repository (target-manifest in argocd-terms)? And if so, did you check that this change is actually deployed in the cluster?
If that does not fix the situation, there has to be some other resource (e.g. application or applicationset) that references your "krowa-parent" app and has self-heal enabled.
Running into this too.
Should the "Disable Auto-Sync" button should be disabled/removed in situations where "self-heal" will simply revert? It's very confusing.
Also check if you have an ApplicatoinSet
that manages your Applications
. In this case all changes to Application
will be instantly undone, no matter what they were made with (UI/argocd cli/CRD)
Also check if you have an
ApplicatoinSet
that manages yourApplications
. In this case all changes toApplication
will be instantly undone, no matter what they were made with (UI/argocd cli/CRD)
I also ran into this issue, which is disconcerting when trying to temporarily adjust settings, perform manual tests, rollbacks, or whatever else. Argo's UI seems to allow disabling regular apps, but when using an ApplicationSet (in my case, to generate ephemeral preview environments based on PRs) I'm unable to turn off the auto sync.
I'm not sure how to recommend a resolution, but this should certainly be addressed in some fashion. I think it's important to be able to disable sync, healing, etc on the apps created by an AppSet.
Is there any movement on this?
@illegalnumbers yes, this will allow folks to exclude fields from ApplicationSet's regular updates: https://github.com/argoproj/argo-cd/pull/14743
I'm running into the same problem. Not using app of apps, literally just kubectl apply -f app.yaml
originally, I had automated
filled in. But then I changed it to automated: {}
and auto-sync is still reported as being enabled. Both from the CLI and UI.
Sync Policy: Automated
I feel like the solution here is a simple one. Add an enabled
field, then this becomes just a boolean value. It's easier to reason about for both the user and the code behind the scenes.
I actually found out that setting this field to the null
equivalent disables auto sync
# Sync policy
syncPolicy:
automated:
seems like it'll sync back to "enable" using all method
syncPolicy: null
In my case, I found a solution.
helm install
command)Disable autosync in application spec:
# application resource spec
syncPolicy: {}
Enable autosync in application spec:
# application resource spec
syncPolicy:
automated:
prune: false
selfHeal: false
or also valid spec:
# application resource spec
syncPolicy:
automated: {}
Warning: You must definitely set
syncPolicy
value to null{}
in order to disable auto-sync.
# application resource spec
- syncPolicy:
- automated: {}
+ syncPolicy: {}
We did this:
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
spec:
ignoreApplicationDifferences:
- jsonPointers:
- /spec/syncPolicy
And that worked!
Argo CD version:
Describe the bug
With app-of-apps pattern, when syncPolicy of a child application changes from "automated" to empty, Argo does not spot the difference. The child application remains in auto-sync mode, although it's desired manifest in the parent app changes
To Reproduce
Expected behavior
Synchronization policy of the child application changes. However, it remains auto-sync. No Diff is spotted in spite of different live and desired manifests
Screenshots
With these live and desired manifests, the Diff tab is empty
Version
Taken from UI
Note: we also spotted #3815. Seems treating of default or boolean values of
syncPolicy
has changed in v1.6