vmware-labs / reconciler-runtime

⚠️ Maintenance suspended. Please, migrate to the active fork reconciler.io/runtime. See https://github.com/reconcilerio/runtime/releases/tag/v0.20.0 for instructions. This repository will be archived eventually.
Other
81 stars 18 forks source link

Switch ResourceManager update cache to JSON Patch #442

Closed scothis closed 9 months ago

scothis commented 9 months ago

It was previously using JSON Merge Patch, which will recreate structures that are trying to be deleted. JSON Patch will fail to apply the patch if the structure being patched doesn't exist.

For example, if a reconciler defined a volume on a Deployment on create/update a mutating webhook will default the file permissions. If the reconciler later needs to remove that volume, the defaulted file permissions will no longer be re-applied.

codecov[bot] commented 9 months ago

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (7ebda64) 60.72% compared to head (141c439) 60.65%. Report is 2 commits behind head on main.

:exclamation: Current head 141c439 differs from pull request most recent head eae3574. Consider uploading reports for the commit eae3574 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #442 +/- ## ========================================== - Coverage 60.72% 60.65% -0.07% ========================================== Files 26 26 Lines 2518 2524 +6 ========================================== + Hits 1529 1531 +2 - Misses 902 904 +2 - Partials 87 89 +2 ``` | [Files](https://app.codecov.io/gh/vmware-labs/reconciler-runtime/pull/442?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vmware-labs) | Coverage Δ | | |---|---|---| | [reconcilers/resourcemanager.go](https://app.codecov.io/gh/vmware-labs/reconciler-runtime/pull/442?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vmware-labs#diff-cmVjb25jaWxlcnMvcmVzb3VyY2VtYW5hZ2VyLmdv) | `76.80% <45.45%> (-2.20%)` | :arrow_down: |

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