fix(app): Fix patch creation for Applications with ValuesObject fields #15126#16602
fix(app): Fix patch creation for Applications with ValuesObject fields #15126#16602PaulSonOfLars wants to merge 22 commits intoargoproj:masterfrom
Conversation
89f6264 to
f95db6c
Compare
…j#15126) Signed-off-by: Vlad Fratila <vlad.fratila@gmail.com> Signed-off-by: Paul Larsen <pnvlarsen@gmail.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: Paul Larsen <pnvlarsen@gmail.com>
Signed-off-by: Vlad Fratila <vlad.fratila@gmail.com> Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
Signed-off-by: Vlad Fratila <vlad.fratila@gmail.com> Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
…ts for both app.Source and app.Sources fields Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
f95db6c to
29c9a09
Compare
…-jsonpatching Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #16602 +/- ##
==========================================
- Coverage 49.73% 49.29% -0.45%
==========================================
Files 274 274
Lines 48948 48192 -756
==========================================
- Hits 24343 23754 -589
+ Misses 22230 22088 -142
+ Partials 2375 2350 -25 ☔ View full report in Codecov by Sentry. |
|
Are there any updates on this? If this resolves the infinite refresh bug with |
…-jsonpatching Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
841b837 to
217ff45
Compare
|
@PaulSonOfLars I don't have any specific comments about the code itself, but could you add a few e2e tests to verify that the patching of |
Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
8689ec7 to
4605562
Compare
Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
|
Hi @blakepettersson, thanks for your comment! I've gone ahead and added an E2E test as requested. I chose to add the test on application sets, since they deal with apps, as well as updating apps - happy to add a more specific application-only one if you'd like (or if theres anything else?). Took me a while to get familiar with the testsuite but I got there in the end! Also found a cleaner refactor for the merge patch along the way which covers more cases and is easier to extend, so worked out well. |
|
@blakepettersson This problem is becoming more and more severe in our production system. It would be awesome if it is merged and released soon. |
It's the same for us, I was thinking it would be merged earlier (i.e. not forking the project) as it breaks probably a lot of applications. |
|
I'm looking to add one more test (hopefully next week) as a sanity check, and then this should be ready to merge from my perspective. If I could get a review before then, I'll make sure to address any comments at the same time as the test - @blakepettersson, @crenshaw-dev? |
|
@PaulSonOfLars really nice job on this! |
Signed-off-by: Paul Larsen <pnvlarsen@gmail.com>
|
Any updates on this getting merged? |
|
I just ran into this issue today, and it's blocking a deployment. I would love to see this merged. |
|
Thank you for the fix! I am seeing this issue as well. Looking forward this being released :) |
|
I'm not fundamentally opposed to the hackaround, but since we apparently made a mistake by using the RawExtension type in the first place I want to give @PaulSonOfLars time to investigate alternatives before we merge a bunch of hack code. Paul, what are your thoughts? Merge this and fix the underlying issue later, or wait a bit to investigate some more? |
|
Can we get this merged? |
|
@crenshaw-dev @PaulSonOfLars any news/eta on this? |
|
@crenshaw-dev Alright, after various attempts to move away from the I'd recommend merging this PR for now, and we can do the move in the future if someone figure it out. For the curious: It comes down to the fact that all strategicpatch merges expect to be done against a typed struct, and a freeform YAML/JSON object can't have that (by definition!). If the upstream k8s libraries exposed an option to fallback to standard json merge patches when no struct was found (or we hit a json.RawMessage type?), we might be able to use that; that would likely be the best path forward. |
|
Cool, let's ship it. I'm super hesitant to ship this with 2.11 since it's a change in such a core piece of code. I'm going to hold it for 2.12. |
|
I want to propose another way to fix this: #18061 The main reason IMHO it is safer. Less code changes and applicable only to
Another reason is I think the changes in |
|
just thought id add, i just started running into this. was booleans as investigated. and the fix referenced worked for me a soon as i updated |
Pull request was closed


Fix patch creation for Applications using ValuesObject fields, and add multiple tests to validate that the fix works as expected.
Tried to cherry pick and retain commit attribution @vladfr, but that might not have worked out well. Feel free happy to rebase onto a cleaner git history if you prefer, my intention wasnt to take ownership - credits go to your fix.
Extends and tests #15227, Fixes #15126
Checklist: