Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Include example kustomization in Helm package
Browse files Browse the repository at this point in the history
The goal has been to never accidentally include non-example
kustomizations, yet not to forget the example kustomization.

This however does not work the way we want it as expressed in
issue #157.

The problem is that .helmignore files are broken when it comes to
negation[1], which we tried to address in commit 25ee3b9, but that
approach also seems to fail.

Instead of relying on .helmignore, we'll now rely on the Makefile to
verify that no non-example kustomizations are in the directory. It's not
pretty, but it works and includes the example sections.

1: helm/helm#3622
  • Loading branch information
feikesteenbergen committed May 18, 2020
1 parent b637b23 commit d831d04
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
21 changes: 19 additions & 2 deletions Makefile
@@ -1,12 +1,29 @@
ROGUE_KUSTOMIZE_FILES := $(shell find charts/timescaledb-single/kustomize/ -mindepth 2 -type f ! -path '*kustomize/example*')
ROGUE_KUSTOMIZE_DIRS := $(shell find charts/timescaledb-single/kustomize/ -mindepth 1 -type d ! -path '*kustomize/example*')

.PHONY: publish
publish: publish-multinode publish-single

.PHONY: publish-multinode
publish-multinode:
helm package charts/timescaledb-multinode --destination charts/repo
helm repo index charts/repo

.PHONY: publish-single
publish-single:
@if [ "$(ROGUE_KUSTOMIZE_FILES)" != "" ]; then \
echo "Found non-example files in the timescaledb-single/kustomize directory"; \
echo "Please remove these files using 'make clean' or manually"; \
echo ""; \
echo "Unfortunately we cannot exclude these files in .helmignore due to"; \
echo " https://github.com/helm/helm/issues/3622"; \
echo ""; \
exit 1; \
fi
helm package charts/timescaledb-single --destination charts/repo
helm repo index charts/repo

.PHONY: publish
publish: publish-multinode publish-single
.PHONY: clean
clean:
@if [ "$(ROGUE_KUSTOMIZE_FILES)" != "" ]; then rm -v $(ROGUE_KUSTOMIZE_FILES); fi
@if [ "$(ROGUE_KUSTOMIZE_DIRS)" != "" ]; then rmdir -v $(ROGUE_KUSTOMIZE_DIRS); fi
5 changes: 1 addition & 4 deletions charts/timescaledb-single/.helmignore
@@ -1,5 +1,2 @@
*.png
*.crt
*.key
pgbackrest.conf
credentials.conf

0 comments on commit d831d04

Please sign in to comment.