Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: using patches instead of patchesStrategicMerge #947

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- 💥[Improvement] Replacing "patchesStrategicMerge" key with "patches" key in the main Kustomization file. [patchesStrategicMerge](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patchesstrategicmerge/) is going to be deprecated in future releases of the Kustomization API. It is replaced by the [patches](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/) key which is more powerful and allows defining different patch types. This has the following consequences:
- The patch "kustomization-patches-strategic-merge" was renamed to "kustomization-patches"
- Extra Kustomization patches added via the "kustomization-patches" Tutor patch must respect the format specified [here](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/). It implies moving old "patchesStrategicMerge" extra patches to the "patches" format.
6 changes: 3 additions & 3 deletions docs/reference/patches.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ File: ``kustomization.yml``

File: ``kustomization.yml``

.. patch:: kustomization-patches-strategic-merge
.. patch:: kustomization-patches

``kustomization-patches-strategic-merge``
``kustomization-patches``
=========================================

File: ``kustomization.yml``

This can be used to add more Kustomization patches that make use of the `strategic merge mechanism <https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/#customizing>`__.
This can be used to add more Kustomization patches. See more details `here <https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/>`__.

.. patch:: kustomization-resources

Expand Down
8 changes: 4 additions & 4 deletions tutor/templates/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ configMapGenerator:
app.kubernetes.io/name: redis
{{ patch("kustomization-configmapgenerator") }}

{%- if patch("k8s-override") or patch("kustomization-patches-strategic-merge") %}
patchesStrategicMerge:
{%- if patch("k8s-override") or patch("kustomization-patches") %}
patches:
{%- if patch("k8s-override") %}
- k8s/override.yml
- path: k8s/override.yml
{%- endif %}
{{ patch("kustomization-patches-strategic-merge") }}
{{ patch("kustomization-patches") }}
{%- endif %}

{{ patch("kustomization") }}