fix(app): use jsonpatch to check for changes in status field (#15126)#15227
fix(app): use jsonpatch to check for changes in status field (#15126)#15227vladfr wants to merge 337 commits intoargoproj:masterfrom
Conversation
50f7680 to
3f533d8
Compare
|
I couldn't really find a good spot for the utility function. It should be moved in |
jannfis
left a comment
There was a problem hiding this comment.
LGTM, thanks for fixing this!
I agree that it should move into gitops-engine later on. We probably need to revive lifecycle management between gitops-engine and Argo CD before, or migrate gitops-engine back into Argo CD though.
For now, I'm fine with this code living in the application controller.
Just for clarification and my understanding, this only affects valuesObject introduced in 2.8, right?
|
@jannfis this fixes a problem with the new field, but it changes how we calculate the app status for every field, so it's pretty darn central. |
|
@crenshaw-dev Yes, I was rather referring to the bug it fixes. So the bug is only in 2.8, and we need to cherry-pick only into that? |
|
@jannfis yep! |
|
And I would assume that since every test, including end-to-end, pass without changes that the change itself is fine. The only concern might be a performance impact of |
|
@jannfis the You have valid points about adding changes to a critical point. I figured it's safe since I can dig a bit to see if there's another way to handle this fix. It seems the problem lies in how the object is being stored in PS: I'm out next week, but I can take another approach after I'm back, or if someone else has input until then, feel free. |
|
@vladfr I think a good first step would be to use a recent version of jsonpatch, e.g. |
|
Hi, is this PR still watched? :) |
|
Hi, sorry for my big delay here. I've looked for a different way to address this. Unfortunately, it's not really clear how I can change the logic to store the valuesObject field separately; besides which, I'm not really sure what's causing the issue with the quotes. So I've modified the patching code to:
PS: I'd like to add an e2e test for this, but I'm still struggling a bit with running these locally. |
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
…oproj#15583) Bumps library/node from 20.6.1 to 20.7.0. --- updated-dependencies: - dependency-name: library/node dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…er (argoproj#15585) Bumps library/node from 20.6.1 to 20.7.0. --- updated-dependencies: - dependency-name: library/node dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pasha-codefresh <pavel@codefresh.io>
…in "high availibility" doc (argoproj#5348) (argoproj#13258) Signed-off-by: Sridhar Nandigam <nandigamsridhar.v@gmail.com>
Signed-off-by: gdsoumya <44349253+gdsoumya@users.noreply.github.com>
…oproj#15595) * feat: added patch_ms to reconciliation logs Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com> * feat: added patch_ms and setop_ms timings to logs Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com> --------- Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
* chore(action): add newlines at eof Signed-off-by: Josh Soref <jsoref@gmail.com> * chore(action): fix whitespace indentation Signed-off-by: Josh Soref <jsoref@gmail.com> * chore(action): use local annotations Signed-off-by: Josh Soref <jsoref@gmail.com> --------- Signed-off-by: Josh Soref <jsoref@gmail.com>
…rting API-Server (argoproj#15574) * feat: auto configure extensions Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> * feat: auto-reload extension configs without restarting api-server Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> * clean unused gorilla mux Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> * update docs Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> * Address review comments Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> * Add more test cases Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> * refactoring to reduce unnecessary function Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> * Add log Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> * fix bugs found during manual tests Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> --------- Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
…oc (argoproj#15619) The supported version policy mentioned in the operator manual installation document diverges from the official policy that is mentioned in the security policy and the release cadence. This change brings the version policy in line by referring the readers to the release and cadence documentation to check the specified policy. Signed-off-by: Muhammad Mooneeb Hussain <mooneeb.hussain@gmail.com>
Signed-off-by: Timoses <timoses@tutanota.com>
…rollback for tree view (argoproj#15572) * app sync and app wait tree view changes Signed-off-by: schakrad <58915923+schakrad@users.noreply.github.com> * documentation changes Signed-off-by: schakrad <58915923+schakrad@users.noreply.github.com> * included the json,yaml and wide formats and removed the value assignment to the flag Signed-off-by: schakrad <58915923+schakrad@users.noreply.github.com> * Reoved extra spaces Signed-off-by: schakrad <58915923+schakrad@users.noreply.github.com> * removed extra spaces Signed-off-by: schakrad <58915923+schakrad@users.noreply.github.com> * refactored the code Signed-off-by: schakrad <58915923+schakrad@users.noreply.github.com> * better log statements Signed-off-by: schakrad <58915923+schakrad@users.noreply.github.com> --------- Signed-off-by: schakrad <58915923+schakrad@users.noreply.github.com>
* Migrate Application Controller from Statefulset to Deployment Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Add sharding deployment logic Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Update sharding logic and add comments Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Add heartbeat as an environment variable Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Add retry logic, heartbeat timeout environment variable Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * use the logic of pre-specified shard number on application controller pod Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * fix manifests Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * fix lint and e2e tests Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * comment out failing e2e test Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * increase readiness probe interval period Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * "comment out readiness probe to see if e2e tests succeed" Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * revert commented readiness probe Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * revert commented test case Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * read environment variable for application controller deployment name Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Add nil check on replica count for deployment of application controller Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Address comments Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Add Informer, Update documentation, add unit tests Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * update godoc Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * remove unwanted code and logs Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Add more documentation Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * revert ApplicationController manifest to StatefulSet Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * reverting updated docs Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Add documentation for the new dynamic distribution feature Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * update documentation Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Add an overlay for application controller deployment and update documentation Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * fix nit Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Marking the feature as alpha Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Add feature status link Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * revert go,mod changes Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * update docs to avoid focusing on StatefulSet/Deployment (argoproj#26) * update docs to avoid focusing on StatefulSet/Deployment Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * minor update to the doc Signed-off-by: ishitasequeira <ishiseq29@gmail.com> --------- Signed-off-by: ishitasequeira <ishiseq29@gmail.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>
* chore(deps): bump node version Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * fix version Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * update lockfile Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* self service notification Signed-off-by: May Zhang <may_zhang@intuit.com> * revert back the changes for redis-ha Signed-off-by: May Zhang <may_zhang@intuit.com> * revert back the changes for redis-ha Signed-off-by: May Zhang <may_zhang@intuit.com> * update notification engine Signed-off-by: May Zhang <may_zhang@intuit.com> * re-trigger build Signed-off-by: May Zhang <may_zhang@intuit.com> * self service notification Signed-off-by: May Zhang <may_zhang@intuit.com> * revert back the changes for redis-ha Signed-off-by: May Zhang <may_zhang@intuit.com> * revert back the changes for redis-ha Signed-off-by: May Zhang <may_zhang@intuit.com> * update notification engine Signed-off-by: May Zhang <may_zhang@intuit.com> * re-trigger build Signed-off-by: May Zhang <may_zhang@intuit.com> * fix conflict Signed-off-by: May Zhang <may_zhang@intuit.com> * fix conflict Signed-off-by: May Zhang <may_zhang@intuit.com> * fix conflict Signed-off-by: May Zhang <may_zhang@intuit.com> * fix conflict Signed-off-by: May Zhang <may_zhang@intuit.com> * update notification enginer version Signed-off-by: May Zhang <may_zhang@intuit.com> * update notification enginer version Signed-off-by: May Zhang <may_zhang@intuit.com> * fixing go tidy Signed-off-by: May Zhang <may_zhang@intuit.com> * fixing go tidy Signed-off-by: May Zhang <may_zhang@intuit.com> * fixing go tidy Signed-off-by: May Zhang <may_zhang@intuit.com> * fixing go tidy Signed-off-by: May Zhang <may_zhang@intuit.com> * fixing go tidy Signed-off-by: May Zhang <may_zhang@intuit.com> * add back checkAppNotInAdditionalNamespaces Signed-off-by: May Zhang <may_zhang@intuit.com> * add cm and secret to clusterRole Signed-off-by: May Zhang <may_zhang@intuit.com> * if applicationNamespaces is not used, then use namespaced appClient Signed-off-by: May Zhang <may_zhang@intuit.com> * fix merge conflict Signed-off-by: May Zhang <may_zhang@intuit.com> * fix doc and test based on review Signed-off-by: May Zhang <may_zhang@intuit.com> * self service notification Signed-off-by: May Zhang <may_zhang@intuit.com> * revert back the changes for redis-ha Signed-off-by: May Zhang <may_zhang@intuit.com> * revert back the changes for redis-ha Signed-off-by: May Zhang <may_zhang@intuit.com> * update notification engine Signed-off-by: May Zhang <may_zhang@intuit.com> * re-trigger build Signed-off-by: May Zhang <may_zhang@intuit.com> * fix conflict Signed-off-by: May Zhang <may_zhang@intuit.com> * self service notification Signed-off-by: May Zhang <may_zhang@intuit.com> * revert back the changes for redis-ha Signed-off-by: May Zhang <may_zhang@intuit.com> * revert back the changes for redis-ha Signed-off-by: May Zhang <may_zhang@intuit.com> * update notification engine Signed-off-by: May Zhang <may_zhang@intuit.com> * re-trigger build Signed-off-by: May Zhang <may_zhang@intuit.com> * fix conflict Signed-off-by: May Zhang <may_zhang@intuit.com> * fix conflict Signed-off-by: May Zhang <may_zhang@intuit.com> * fix conflict Signed-off-by: May Zhang <may_zhang@intuit.com> * update notification enginer version Signed-off-by: May Zhang <may_zhang@intuit.com> * update notification enginer version Signed-off-by: May Zhang <may_zhang@intuit.com> * fixing go tidy Signed-off-by: May Zhang <may_zhang@intuit.com> * fixing go tidy Signed-off-by: May Zhang <may_zhang@intuit.com> * fixing go tidy Signed-off-by: May Zhang <may_zhang@intuit.com> * fixing go tidy Signed-off-by: May Zhang <may_zhang@intuit.com> * fixing go tidy Signed-off-by: May Zhang <may_zhang@intuit.com> * add back checkAppNotInAdditionalNamespaces Signed-off-by: May Zhang <may_zhang@intuit.com> * add cm and secret to clusterRole Signed-off-by: May Zhang <may_zhang@intuit.com> * if applicationNamespaces is not used, then use namespaced appClient Signed-off-by: May Zhang <may_zhang@intuit.com> * fix doc and test based on review Signed-off-by: May Zhang <may_zhang@intuit.com> * disable defining and using secrets within notification templates for self-service Signed-off-by: May Zhang <may_zhang@intuit.com> * tweaks Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * fix docs formatting Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * more docs and Procfile update for local run convenience Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: May Zhang <may_zhang@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>
* fix: Tooltips point in wrong direction#11935 Signed-off-by: Teng, Jessie <yilin.teng@fmr.com> * fix: Tooltips point in wrong direction#11935 Signed-off-by: Teng <yilin.teng@fmr.com> --------- Signed-off-by: Teng, Jessie <yilin.teng@fmr.com> Signed-off-by: Teng <yilin.teng@fmr.com> Co-authored-by: Teng, Jessie <a715260@fmr.com>
* fix(11164): Advanced templating using patchTemplate Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> * small changes Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: gmuselli <geoffrey.muselli@gmail.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>
…sInAnyNamespaceEnabled flag is set (argoproj#16249) Signed-off-by: Eilers, Jonas <133217951+jdvgh@users.noreply.github.com>
…rgoproj#16062) (argoproj#16241) * fix(appset): store sha from webhook to get latest change during reconcile (argoproj#16062) Signed-off-by: dhruvang1 <dhruvang1@users.noreply.github.com> * fix(appset): Don't use revision cache when reconciling after webhook(argoproj#16062) Signed-off-by: dhruvang1 <dhruvang1@users.noreply.github.com> --------- Signed-off-by: dhruvang1 <dhruvang1@users.noreply.github.com>
Signed-off-by: gmuselli <geoffrey.muselli@gmail.com>
…ssue argoproj#16523) (argoproj#16520) * Update cert-manager.opcertificate health.lua Signed-off-by: Chris Murray <chris@distrail.io> * adding test case for cert issuing Signed-off-by: Chris Murray <chris@distrail.io> * fixing typo Signed-off-by: Chris Murray <chris@distrail.io> --------- Signed-off-by: Chris Murray <chris@distrail.io>
…t platforms (argoproj#16065) Signed-off-by: Ondrej Sika <ondrej@ondrejsika.com>
Signed-off-by: Josh Soref <jsoref@gmail.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Wrongly placed horizontal line (`----`) was formatting code-block as a header. Fixed it with a necessary line break Signed-off-by: Elouan Keryell-Even <elouan.keryell@gmail.com>
Signed-off-by: Phil Nichol <35630607+philnichol@users.noreply.github.com>
…6560) Signed-off-by: Jesse Suen <jesse@akuity.io>
…proj#16364) Signed-off-by: Rotem Tamir <rotemtamir@gmail.com>
… allow app's deletion (argoproj#12172) (argoproj#16506) * fix(appset): remove unnecessary condition Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * docs: update explanation about policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
Signed-off-by: Jay Shah <jay.shah@konghq.com>
…oj#16581) * chore: upgrade kubernetes dependencies from 0.26.4 to 0.26.11 Fixes some vulnerabilities trivy is reporting on (not necessarily vulnerabe, trivy tends to have a lot of false positives when it comes to golang projects): * CVE-2023-3676 * CVE-2023-3955 * CVE-2023-5528 * CVE-2023-2431 * CVE-2023-2727 * CVE-2023-2728 Signed-off-by: Zoltán Reegn <zoltan.reegn@gmail.com> * go mod tidy Signed-off-by: Zoltán Reegn <zoltan.reegn@gmail.com> * Add go mod tidy to kubernetes updater script Signed-off-by: Zoltán Reegn <zoltan.reegn@gmail.com> --------- Signed-off-by: Zoltán Reegn <zoltan.reegn@gmail.com>
Signed-off-by: Elouan Keryell-Even <elouan.keryell@gmail.com>
…ns (argoproj#16534) Signed-off-by: dmpe <cincenko@outlook.com>
when applying a patch, the rawextenstion object used for valuesObject needs to be diffed with jsonpatch instead of the default strategic merge Signed-off-by: Vlad Fratila <vlad.fratila@gmail.com>
Signed-off-by: Vlad Fratila <vlad.fratila@gmail.com>
Signed-off-by: Vlad Fratila <vlad.fratila@gmail.com>
Signed-off-by: Vlad Fratila <vlad.fratila@gmail.com>
|
@crenshaw-dev The new code now uses PS: Sorry about this, I've mistakenly ran a rebase. We can cut another PR once this is closer to being merged. (i.e. add tests) |
|
Closing in favor of #16602 |
This PR changes the way patches are computed for annotations and status. Because Helm source can have unstructured fields in
helm.valuesObject, the strategic patching gives unpredictable behaviour. It was never meant to be used without astruct(see Helm Issue). So we usejsonpatchinstead. This should yield the same results, and the library is already present in Argo as a dependency.Checklist:
Fixes #15126