File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ helm_chart_sources := $(shell find $(helm_chart_source_dir) -maxdepth 1 -type f)
4444helm_chart_archive := $(bin_dir ) /scratch/helm/$(helm_chart_name ) -$(helm_chart_version ) .tgz
4545helm_digest_path := $(bin_dir ) /scratch/helm/$(helm_chart_name ) -$(helm_chart_version ) .digests
4646helm_digest = $(shell head -1 $(helm_digest_path ) 2> /dev/null)
47+ HELM_IGNORE_FIELDS ?= 'app.kubernetes.io/version\|helm.sh/chart\|chart:\|appVersion:\|managed-by:\|meta.helm.sh/release-namespace'
48+ helm_chart_old_version ?=
4749
4850$(bin_dir ) /scratch/helm :
4951 @mkdir -p $@
@@ -187,3 +189,19 @@ verify-helm-kubeconform: $(helm_chart_archive) | $(NEEDS_KUBECONFORM)
187189 -strict
188190
189191shared_verify_targets_dirty += verify-helm-kubeconform
192+
193+ .PHONY helm-diff
194+ helm-diff : $(helm_chart_archive ) | $(NEEDS_HELM )
195+ @if [ -z " $( helm_chart_old_version) " ] then ; \
196+ echo " Usage: make helm-diff helm_chart_old_version=<version>" ; \
197+ exit 1; \
198+ fi
199+
200+ @TMP_OLD=$$(mktemp -d);
201+ @TMP_NEW=$$(mktemp -d);
202+ @OUTPUT_DIR=$$(mktemp -d);
203+
204+ $(HELM) template cert-manager --repo "oci://$(helm_chart_image_registry)" --version "$(helm_chart_old_version)" > $${TMP_OLD}/old.yaml;
205+ $(HELM) template $(helm_chart_archive) > $${TMP_NEW}/new.yaml;
206+
207+ diff -u <(grep -vE $(HELM_IGNORE_FIELDS) $${TMP_OLD}/old.yaml) <(grep -vE $(HELM_IGNORE_FIELDS) $${TMP_NEW}/new.yaml) | tee "$(OUTPUT_DIR)/diff.txt" || true;
You can’t perform that action at this time.
0 commit comments