Open AnhQKatalon opened 1 year ago
We're also having a similar issue. The databaseFlags section was removed, and it's visibly missing in the desired manifest, but no diff is displayed (and the setting isn't syncing). Live Manifest:
Desired Manifest:
Diff:
Argo CD version:
{ "Version": "v2.6.1+3f143c9", "BuildDate": "2023-02-08T18:51:05Z", "GitCommit": "3f143c9307f99a61bf7049a2b1c7194699a7c21b", "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 had the same problem, I spent a day debugging the code and I found a problem.
When argo-cd compares the difference, it will not only compare the difference between target yaml and live yaml, but also compare the difference between target yaml and last-applied-configuration yaml. The difference between the two is that the target yaml and live yaml compare the parts that need to be modified, but do not include the parts that need to be deleted. Compare the target yaml with the last-applied-configuration yaml to get the part that needs to be deleted. Then merge the two comparison results to get the final patch result.
Therefore, please check that after you modify the yaml, if there is no difference between the last-applied-configuration yaml and the target yaml, then we cannot see the content that needs to be deleted in the diff.
I had the same problem, I spent a day debugging the code and I found a problem.
When argo-cd compares the difference, it will not only compare the difference between target yaml and live yaml, but also compare the difference between target yaml and last-applied-configuration yaml. The difference between the two is that the target yaml and live yaml compare the parts that need to be modified, but do not include the parts that need to be deleted. Compare the target yaml with the last-applied-configuration yaml to get the part that needs to be deleted. Then merge the two comparison results to get the final patch result.
Therefore, please check that after you modify the yaml, if there is no difference between the last-applied-configuration yaml and the target yaml, then we cannot see the content that needs to be deleted in the diff.
Appreciate your help so much. So I think I got the reason
If I use Lens / K9s to MODIFY the K8s object, the last-applied-configuration
section will remain no change, so that's why ArgoCD sees no diff, because the Desired (Target) manifest is the same as the last-applied-configuration
If I write out the new manifest to a yaml file and use kubectl apply -f
to apply it, the last-applied-configuration
will change and match with the new manifest. Then ArgoCD can be able to see the diff between the Desired (Target) manifest and the last-applied-configuration
Please correct me if I am wrong
@AnhQKatalon Confirmed, I just ran into this on my instance of Argo where a change was introduced with kubectl edit
and the last-applied-configuration
was now no longer matching the actual values inside of the configMap I was attempting to sync.
Duplicate of https://github.com/argoproj/argo-cd/issues/7951
Checklist:
argocd version
.Describe the bug I have the following manifest that is managed by ArgoCD
When I use Lens/K9s to MODIFY any existing field like the port number
8080
->8081
, or hosts toai-e2etg.test.com
-> ArgoCD will detect diff, mark the object as out of sync, and sync the object to the desired value from Git -> This is OKBut when I use Lens/K9s to edit and ADD some new field to the object like
timeout: 5s
,rewrite
or the other new fields like the below manifest -> ArgoCD shows no diff -> nothing happens -> the object will not be reverted to the desired value from Git -> This is not my expectationTo Reproduce
timeout: 5s
orrewrite
or any other new fields -> Save and CloseExpected behavior
Screenshots
ArgoCD UI showing that the Live Manifest has the field
timeout: 5s
ArgoCD UI showing that the Desired Manifest does not have the field
timeout: 5s
ArgoCD UI showing empty DIFF
Version
Additional information
Using the EDIT function on ArgoCD UI gives the same result.
Tested with
kind: Service
gives the same result alsosynced
If I write out the new manifest to a YAML file and then use
kubectl apply -f
to apply that YAML, then ArgoCD can be able to detect diff and sync back the object.