tutor icon indicating copy to clipboard operation
tutor copied to clipboard

Enhancement: use "patches" instead of "patchesStrategicMerge"

Open jfavellar90 opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe.

It is not related to a problem, but a functionality limitation. PatchesStrategicMerge (used here ) is going to be deprecated in future releases of the Kustomization API and can be easily replaced by the patches key. It is more powerful and allows defining different patch types (including PatchesStrategicMerge). It works for the Kustomization API version currently used by Tutor, from Kubectl 1.24 and upwards (See the Kubectl-Kustomize version equivalence here ).

Describe the solution you'd like

The set of changes is pretty straightforward, please see this commit to take a closer look

jfavellar90 avatar Nov 16 '23 17:11 jfavellar90

Thanks for the bug description @jfavellar90. Transitioning from "patchesStrategicMerge" to "patches" is going to be a breaking change, so we should make that change in Quince.

regisb avatar Nov 23 '23 11:11 regisb

Solved by #947. Thank you Jhony!

regisb avatar Nov 24 '23 08:11 regisb

@regisb Unfortunately we'll need to revert #947. An issue in Kustomize prevents having multiple patches in the same file. For instance, in the pod-autoscaling plugin, there are multiple patches in the override.yml file separated by ---. This is not accepted by the new "patches" key, at least not before Kustomize 5.2.1 (the issue was already fixed here ). It would force to split the patches into different files, which is definitively not desirable. Given that the latest Kubectl version (1.28.4 at this date) is delivered with Kustomize 5.0.4, we'll need to delay this change until we get a version with the issued fixed.

jfavellar90 avatar Nov 24 '23 13:11 jfavellar90

Thanks for the detailed explanation @jfavellar90! I'll mark the issue as "blocked" until Kustomize 5.2.1 is the new default.

regisb avatar Nov 24 '23 13:11 regisb