From 2145f41c7f72b26e1b195e997132a7c8a89352ef Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Tue, 25 Jun 2024 14:33:07 +0200 Subject: [PATCH] Use patch with --no-backup-if-mismatch (#181) Add option `--no-backup-if-mismatch` to every patch command, so it will not create .orig and .diff files anymore --- packages/core/fluxcd/Makefile | 2 +- packages/system/dashboard/Makefile | 2 +- packages/system/ingress-nginx/Makefile | 2 +- packages/system/kamaji-etcd/Makefile | 6 +++--- packages/system/kubeovn/Makefile | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/core/fluxcd/Makefile b/packages/core/fluxcd/Makefile index 44897f9f..6da8d847 100644 --- a/packages/core/fluxcd/Makefile +++ b/packages/core/fluxcd/Makefile @@ -17,4 +17,4 @@ diff: update: rm -rf charts helm pull oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator --untar --untardir charts - patch -p1 --no-backup-if-mismatch < patches/kubernetesEnvs.diff + patch --no-backup-if-mismatch -p1 < patches/kubernetesEnvs.diff diff --git a/packages/system/dashboard/Makefile b/packages/system/dashboard/Makefile index f7a66c71..e7a91bd4 100644 --- a/packages/system/dashboard/Makefile +++ b/packages/system/dashboard/Makefile @@ -19,7 +19,7 @@ update-chart: update-dockerfiles: tag=$$(git ls-remote --tags --sort="v:refname" https://github.com/vmware-tanzu/kubeapps | awk -F'[/^]' 'END{print $$3}') && \ wget https://github.com/vmware-tanzu/kubeapps/raw/$${tag}/cmd/kubeapps-apis/Dockerfile -O images/kubeapps-apis/Dockerfile && \ - patch images/kubeapps-apis/Dockerfile < images/kubeapps-apis/dockerfile.diff && \ + patch --no-backup-if-mismatch images/kubeapps-apis/Dockerfile < images/kubeapps-apis/dockerfile.diff && \ node_image=$$(wget -O- https://github.com/vmware-tanzu/kubeapps/raw/main/dashboard/Dockerfile | awk '/FROM bitnami\/node/ {print $$2}') && \ sed -i "s|FROM .* AS build|FROM $${node_image} AS build|" images/dashboard/Dockerfile && \ version=$$(echo "$$tag" | sed 's/^v//') && \ diff --git a/packages/system/ingress-nginx/Makefile b/packages/system/ingress-nginx/Makefile index 831ef0a0..010612d5 100644 --- a/packages/system/ingress-nginx/Makefile +++ b/packages/system/ingress-nginx/Makefile @@ -8,7 +8,7 @@ update: helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm repo update ingress-nginx helm pull ingress-nginx/ingress-nginx --untar --untardir charts - patch -p 3 < patches/add-metrics2.patch + patch --no-backup-if-mismatch -p 3 < patches/add-metrics2.patch rm -f charts/ingress-nginx/templates/controller-deployment.yaml.orig rm -rf charts/ingress-nginx/changelog/ #sed -i '/ type:/a \ allocateLoadBalancerNodePorts: false' charts/ingress-nginx/templates/controller-service.yaml diff --git a/packages/system/kamaji-etcd/Makefile b/packages/system/kamaji-etcd/Makefile index b2f909b8..a5419dbb 100644 --- a/packages/system/kamaji-etcd/Makefile +++ b/packages/system/kamaji-etcd/Makefile @@ -4,6 +4,6 @@ update: helm repo update clastix helm pull clastix/kamaji-etcd --untar --untardir charts sed -i 's/hook-failed/before-hook-creation,hook-failed/' `grep -rl hook-failed charts` - patch -p4 < patches/fix-svc.diff - patch -p4 < patches/fullnameOverride.diff - patch -p4 < patches/remove-plus.patch + patch --no-backup-if-mismatch -p4 < patches/fix-svc.diff + patch --no-backup-if-mismatch -p4 < patches/fullnameOverride.diff + patch --no-backup-if-mismatch -p4 < patches/remove-plus.patch diff --git a/packages/system/kubeovn/Makefile b/packages/system/kubeovn/Makefile index 783005ba..b47ba177 100644 --- a/packages/system/kubeovn/Makefile +++ b/packages/system/kubeovn/Makefile @@ -10,7 +10,7 @@ update: rm -rf charts && mkdir -p charts/kube-ovn curl -sSL https://github.com/kubeovn/kube-ovn/archive/refs/heads/master.tar.gz | \ tar xzvf - --strip 1 kube-ovn-master/charts - patch -p4 --no-backup-if-mismatch < patches/cozyconfig.diff + patch --no-backup-if-mismatch -p4 < patches/cozyconfig.diff ln -s ../../images charts/kube-ovn/images sed -i '/image:/ s/{{.*}}/{{ include "kubeovn.image" . }}/g' `grep -rl image: charts/kube-ovn/templates/`