Matthieu MOREL
ccee58366a
chore: enable unused-parameter and var-declaration from revive ( #668 )
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 09:55:39 -05:00
Matthieu MOREL
7ac688a30f
chore: enable use-any from revive ( #667 )
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-06 18:20:29 -05:00
Matthieu MOREL
f948991e78
chore: enable gofumpt, gosimple and whitespace linters ( #666 )
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-06 17:07:19 -05:00
Siddhesh Ghadi
7e21b91e9d
Merge commit from fork
...
map[] in error output exposes secret data in last-applied-annotation
& patch error
Invalid secrets with stringData exposes the secret values in diff. Attempt a
normalization to prevent it.
Refactor stringData to data conversion to eliminate code duplication
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
2025-01-29 10:51:13 -05:00
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
Siddhesh Ghadi
9ab0b2ecae
feat: Add ability to hide certain annotations on secret resources ( #577 )
...
* Add option to hide annotations on secrets
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
* Handle err
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
* Move hide logic to a generic func
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
* Remove test code
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
* Address review comments
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
* Handle lastAppliedConfig special case
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
* Fix if logic and remove comments
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
---------
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
2024-10-29 12:29:52 +02:00
Michael Crenshaw
72bcdda3f0
chore: avoid unnecessary json marshal ( #626 )
...
* chore: avoid unnecessary json marshal
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* more tests
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* refactor test to satisfy sonarcloud
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
---------
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-09-17 13:19:20 -04:00
Michael Crenshaw
df9b446fd7
chore: avoid unnecessary json unmarshal ( #627 )
...
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2024-09-16 16:42:18 -04:00
Paul Gier
4386ff4b8d
chore: remove duplicate scheme import ( #580 )
...
Signed-off-by: Paul Gier <paul.gier@datastax.com>
2024-06-25 14:54:38 -04:00
Leonardo Luz Almeida
0aecd43903
fix: handle nil ParseableType from GVKParser ( #574 )
...
* fix: handle nil ParseableType from GVKParser
Signed-off-by: Leonardo Luz Almeida <leoluz@users.noreply.github.com>
* address review comments
Signed-off-by: Leonardo Luz Almeida <leoluz@users.noreply.github.com>
---------
Signed-off-by: Leonardo Luz Almeida <leoluz@users.noreply.github.com>
2024-05-09 13:07:15 -04:00
Leonardo Luz Almeida
c1e23597e7
fix: address kubectl auth reconcile during server-side diff ( #562 )
...
* fix: address kubectl auth reconcile during server-side diff
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* server-side diff force conflict
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* do not ssa when ssd rbac
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* debug
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* better logs
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* remove debug
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* add comments
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* better comments
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* refactoring on rbacReconcile
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
---------
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2024-01-22 09:58:03 -05:00
Leonardo Luz Almeida
aba38192fb
feat: Implement Server-Side Diffs ( #522 )
...
* feat: Implement Server-Side Diffs
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* trigger build
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* chore: remove unused function
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* make HasAnnotationOption more generic
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* add server-side-diff printer option
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* remove managedFields during server-side-diff
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* add ignore mutation webhook logic
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* fix configSet
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Fix comparison
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* merge typedconfig in typedpredictedlive
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* handle webhook diff conflicts
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Fix webhook normalization logic
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* address review comments 1/2
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* address review comments 2/2
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* fix lint
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* remove kubectl getter from cluster-cache
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* fix query param verifier instantiation
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* Add server-side-diff unit tests
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
---------
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-12-18 14:45:13 -05:00
Leonardo Luz Almeida
98ccd3d43f
fix: calculate SSA diffs with smd.merge.Updater ( #467 )
...
* fix: refactor ssa diff logic
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* fix: calculate ssa diff with smd.merge.Updater
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* chore: Add golangci config file
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* fix: remove wrong param passed to golanci-ghaction
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* doc: Add doc to the wrapper file
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* doc: Add instructions about how to extract the openapiv2 document from
k8s
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* better wording
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* better code comments
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-10-04 09:23:20 -04:00
Leonardo Luz Almeida
3951079de1
fix: remove last-applied-configuration before diff in ssa ( #460 )
...
* fix: remove last-apply-configurations before diff in ssa
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* fix: add tests to validate expected behaviour
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-09-16 10:22:00 -04:00
Leonardo Luz Almeida
c036d3f6b0
fix: sort fields to correctly calculate diff in server-side apply ( #456 )
...
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-08-29 14:50:54 +02:00
Leonardo Luz Almeida
6cde7989d5
fix: structured-merge diff apply default values in live resource ( #435 )
...
* fix: structured-merge diff apply default values in live resource
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* address review comments
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-08-03 10:57:58 -04:00
Leonardo Luz Almeida
1c4ef33687
feat: Add server-side apply manager config ( #418 )
...
* feat: Add server-side apply manager config
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Force conflicts when SSA
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Implement strategic-merge patch in diff
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Implement structured merge diff
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Implement structured merge in diff
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Fix parseable type conversion
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Handle structured merge diff for create/delete operations
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* User NormalizeUnionsApply instead of Merge for structured-merge diff
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* NormalizeUnions
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* merge first than normalize union
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* calculate diff with fieldsets
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* extract managed fields
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* remove managed fields then merge
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Just remove fields if manager is found
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* remove config fieldset instead of using managed fields
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Structure merge diff with defaults
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* tests
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Normalize union at the end
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* test
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* test
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Remove fields after merging
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* test
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* test
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* apply defaults when building diff result
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* fix default func call
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Fix diff default
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* fix merged object
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* keep diff order
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* apply default with patch
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* handle ssa diffs with resource annotations
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* use managed fields to calculate diff
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* Implement unit tests
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* fix bad merge
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* add test to validate service with multiple ports
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* resolveFromStaticParser optimization
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
* try without reordering while patching default values
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-08-02 14:48:09 -04:00
Josh Soref
55bb49480a
chore: Spelling ( #215 )
...
* spelling: account
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: aggregation
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: annotations
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: argocd
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: does-not
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: donot
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: do-not
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: implementers
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: individual
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: openshift
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: relate
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: requeuing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: settings
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: worse
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: youtube
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <michael@crenshaw.dev>
2022-04-12 13:35:40 -04:00
Rо́man
b0c5e00ccf
fix: add default protocol to subset of ports if it is empty ( #347 )
...
Signed-off-by: Roman Rudenko <3kmnazapad@gmail.com>
2022-01-26 10:45:17 -08:00
Leonardo Luz Almeida
f6495020a3
fix: removeNamespaceAnnotation should not panic if annotation has unexpected value ( #361 )
...
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2021-12-22 11:16:05 -08:00
Leonardo Luz Almeida
c0b63afb74
fix: Address issue during diff when secret data is nil ( #345 )
...
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2021-11-02 12:00:06 -07:00
Mikhail Mazurskiy
11e322186b
refactor: reduce usage of k8s.io/kubernetes packages ( #258 )
...
Signed-off-by: Mikhail Mazurskiy <mmazurskiy@gitlab.com>
2021-04-20 10:54:02 -07:00
Mikhail Mazurskiy
32c6afc4a7
refactor: Kubernetes v1.20.1 ( #195 )
...
Signed-off-by: Mikhail Mazurskiy <mmazurskiy@gitlab.com>
2021-01-05 19:35:02 -08:00
Jesse Suen
cfdefa46b2
feat: introduce SyncWaveHook callbacks invoked after applying each sync wave ( #177 )
...
Signed-off-by: Jesse Suen <jesse_suen@intuit.com>
2020-10-30 12:46:27 -07:00
Mikhail Mazurskiy
31311943a5
refactor: use github.com/go-logr/logr for logging ( #162 )
2020-10-26 17:14:56 -07:00
Jonathan West
872c470033
fix: Detect unknown fields in invalid specs as OutOfSync ( #154 )
2020-10-14 11:34:19 -07:00
William Tam
a1dc4c598b
fix: sort endpoint IP addresses before diffing ( #160 )
2020-10-13 16:53:40 -07:00
Alexander Matyushentsev
2cf3a72c65
fix: exclude creationTimestamp from diffing ( #128 )
2020-08-25 23:29:57 -07:00
Alexander Matyushentsev
0eede8069a
fix: volumeClaimTemplates are out of sync incorrectly ( #127 )
2020-08-24 16:26:41 -07:00
Mikhail Mazurskiy
bf8e17f73f
Update and trim dependencies ( #123 )
...
* chore: bump kubernetes deps
* refactor: remove dependency on pkg/errors
* refactor: remove indirect dependency version
* refactor: remove dependency on github.com/google/shlex
as it was only used in tests
2020-08-21 18:49:00 -07:00
Alexander Matyushentsev
eb210cf6d1
fix: diffing should not fail if known kubernetes resource has invalid fields ( #88 )
2020-07-13 10:21:25 -07:00
Alexander Matyushentsev
6fe0c0050b
fix: diff should perform server side like apply during resource diffing ( #82 )
2020-07-09 13:44:23 -07:00
Alexander Matyushentsev
c23d4d77d8
fix: don't remove defaulted fields and rely only on three way diff merge during diffing ( #68 )
...
* fix: don't remove defaulted fields and rely only on three way diff merge during diffing
2020-06-30 14:33:07 -07:00
Mikhail Mazurskiy
7d3da9f16e
Replace ghodss/yaml with sigs.k8s.io/yaml ( #62 )
...
Kubernetes community uses a permanent fork
https://github.com/kubernetes-sigs/yaml
2020-06-23 10:27:53 -07:00
Mikhail Mazurskiy
5622a64808
Reduce k8s.io/kubernetes usage ( #57 )
2020-06-10 09:09:27 -07:00
Alexander Matyushentsev
1723191dde
refactor: deprecates obsolete Diff field ( #54 )
2020-06-07 20:22:37 -07:00
Alexander Matyushentsev
df17961bbd
docs: document 'top level' packages ( #44 )
...
* docs: document cache package
* docs: document diff package
* docs: document health package
* docs: document sync package
* docs: document engine package
* docs: document sync options
2020-06-01 17:54:33 +02:00
Alexander Matyushentsev
99bd42d9a3
fix: update packages structure ( #42 )
2020-05-28 17:18:31 -07:00