argo-cd/pkg/diff/testdata
Andrii Korotkov 8849c3f30c
fix: Server side diff now works correctly with fields removal (#640)
* fix: Server side diff now works correctly with some fields removal

Helps with https://github.com/argoproj/argo-cd/issues/20792

Removed and modified sets may only contain the fields that changed, not including key fields like "name". This can cause merge to fail, since it expects those fields to be present if they are present in the predicted live.
Fortunately, we can inspect the set and derive the key fields necessary. Then they can be added to the set and used during a merge.
Also, have a new test which fails before the fix, but passes now.

Failure of the new test before the fix
```
            	Error:      	Received unexpected error:
            	            	error removing non config mutations for resource Deployment/nginx-deployment: error reverting webhook removed fields in predicted live resource: .spec.template.spec.containers: element 0: associative list with keys has an element that omits key field "name" (and doesn't have default value)
            	Test:       	TestServerSideDiff/will_test_removing_some_field_with_undoing_changes_done_by_webhook
```

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Use new version of structured merge diff with a new option

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Add DCO

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Try to fix sonar exclusions config

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

---------

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
2024-12-11 15:28:47 -05:00
..
aggr-clusterrole-config.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
aggr-clusterrole-live.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
data.go fix: Server side diff now works correctly with fields removal (#640) 2024-12-11 15:28:47 -05:00
deployment-config.json fix: diff should perform server side like apply during resource diffing (#82) 2020-07-09 13:44:23 -07:00
deployment-live.json fix: don't remove defaulted fields and rely only on three way diff merge during diffing (#68) 2020-06-30 14:33:07 -07:00
elasticsearch-config.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
elasticsearch-live.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
endpoints-config.json fix: add default protocol to subset of ports if it is empty (#347) 2022-01-26 10:45:17 -08:00
endpoints-live.json fix: add default protocol to subset of ports if it is empty (#347) 2022-01-26 10:45:17 -08:00
grafana-clusterrole-config.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
grafana-clusterrole-live.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
mutatingwebhookconfig-config.json fix: add missing scheme install imports (#89) 2020-07-14 09:32:49 -07:00
mutatingwebhookconfig-live.json fix: add missing scheme install imports (#89) 2020-07-14 09:32:49 -07:00
openapiv2.bin fix: calculate SSA diffs with smd.merge.Updater (#467) 2022-10-04 09:23:20 -04:00
sealedsecret-config.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
sealedsecret-live.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
smd-deploy-config.yaml fix: calculate SSA diffs with smd.merge.Updater (#467) 2022-10-04 09:23:20 -04:00
smd-deploy-live.yaml fix: calculate SSA diffs with smd.merge.Updater (#467) 2022-10-04 09:23:20 -04:00
smd-deploy2-config.yaml fix: Server side diff now works correctly with fields removal (#640) 2024-12-11 15:28:47 -05:00
smd-deploy2-live.yaml fix: Server side diff now works correctly with fields removal (#640) 2024-12-11 15:28:47 -05:00
smd-deploy2-predicted-live.json fix: Server side diff now works correctly with fields removal (#640) 2024-12-11 15:28:47 -05:00
smd-service-config-2-ports.yaml feat: Add server-side apply manager config (#418) 2022-08-02 14:48:09 -04:00
smd-service-config-ports.yaml feat: Add server-side apply manager config (#418) 2022-08-02 14:48:09 -04:00
smd-service-config.yaml fix: calculate SSA diffs with smd.merge.Updater (#467) 2022-10-04 09:23:20 -04:00
smd-service-live-with-type.yaml feat: Add server-side apply manager config (#418) 2022-08-02 14:48:09 -04:00
smd-service-live.yaml fix: calculate SSA diffs with smd.merge.Updater (#467) 2022-10-04 09:23:20 -04:00
spinnaker-sa-config.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
spinnaker-sa-live.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
ssd-service-config.yaml feat: Implement Server-Side Diffs (#522) 2023-12-18 14:45:13 -05:00
ssd-service-live.yaml feat: Implement Server-Side Diffs (#522) 2023-12-18 14:45:13 -05:00
ssd-service-predicted-live.json feat: Implement Server-Side Diffs (#522) 2023-12-18 14:45:13 -05:00
wordpress-config.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00
wordpress-live.json fix: update packages structure (#42) 2020-05-28 17:18:31 -07:00