flagger icon indicating copy to clipboard operation
flagger copied to clipboard

Use `Patch` instead of `Update` for Deployment scaling

Open relu opened this issue 10 months ago • 2 comments

This should avoid frequent "Operation cannot be fulfilled" errors from polluting Canary resource events and logs.

relu avatar Apr 24 '24 11:04 relu

Codecov Report

Attention: Patch coverage is 66.66667% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 34.09%. Comparing base (5e6815d) to head (553184b). Report is 1 commits behind head on main.

Files Patch % Lines
pkg/canary/deployment_controller.go 66.66% 3 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1634      +/-   ##
==========================================
- Coverage   34.10%   34.09%   -0.01%     
==========================================
  Files         282      282              
  Lines       20557    20554       -3     
==========================================
- Hits         7011     7008       -3     
  Misses      12616    12616              
  Partials      930      930              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 24 '24 11:04 codecov-commenter

@aryan9600 I pushed an attempt to solve that for the DS controller, but I'm not convinced it's the right way to go. Since we don't have a replicas field on the DaemonSet, we're working with the nodeSelector instead. Because that's a map, the only options to patch are via StrategicMerge (nullifying the values) or JSONPatch.

relu avatar Apr 30 '24 15:04 relu

okay, then lets keep that out of this PR. we can look into it outside of here.

aryan9600 avatar May 14 '24 08:05 aryan9600

Cool. I've removed the commit with the changes to the DS controller and we can revisit it in a separate PR.

relu avatar May 15 '24 07:05 relu

1 small question here, can we have multiple fields that can be patched with a single command? Like if replicas and labels both need to be patched. I couldn't find it anywhere.

shivamnarula avatar Sep 05 '24 09:09 shivamnarula