From 895e8916b36785155a860956bf273059a92d112c Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Mon, 14 Feb 2022 16:28:21 +0100 Subject: [PATCH 1/4] Make the helm-template script use helmfile --- hack/bin/helm-template.sh | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/hack/bin/helm-template.sh b/hack/bin/helm-template.sh index d72684ce9b..3587aa94f0 100755 --- a/hack/bin/helm-template.sh +++ b/hack/bin/helm-template.sh @@ -4,25 +4,20 @@ # hack/helm_vars as overrrides, if available. This allows debugging helm # templating issues without actually installing anything, and without needing # access to a kubernetes cluster -USAGE="Usage: $0" set -e -chart=${1:?$USAGE} - DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" TOP_LEVEL="$DIR/../.." CHARTS_DIR="${TOP_LEVEL}/.local/charts" +: "${FEDERATION_DOMAIN:=example.com}" +: "${NAMESPACE:=namespace1}" -valuesfile="${DIR}/../helm_vars/${chart}/values.yaml" -certificatesfile="${DIR}/../helm_vars/${chart}/certificates.yaml" -declare -a options=() -if [ -f "$valuesfile" ]; then - options+=(-f "$valuesfile") -fi -if [ -f "$certificatesfile" ]; then - options+=(-f "$certificatesfile") +export FEDERATION_DOMAIN +export NAMESPACE + +if [ ! -f "$DIR/../helm_vars/wire-server/certificates-namespace1.yaml" ]; then + "$DIR/selfsigned-kubernetes.sh" namespace1 fi -"$DIR/update.sh" "$CHARTS_DIR/$chart" -helm template $"chart" "$CHARTS_DIR/$chart" ${options[*]} +helmfile -f "$DIR/../helmfile-single.yaml" template "$@" From 96b08b70ab8bc9d2bc50dee907fae087edd5a4a7 Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Mon, 14 Feb 2022 16:32:08 +0100 Subject: [PATCH 2/4] Add CHANGELOG entry --- changelog.d/5-internal/helmfile-template | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/5-internal/helmfile-template diff --git a/changelog.d/5-internal/helmfile-template b/changelog.d/5-internal/helmfile-template new file mode 100644 index 0000000000..36eb119a54 --- /dev/null +++ b/changelog.d/5-internal/helmfile-template @@ -0,0 +1 @@ +Make the helm-template script use helmfile From 6e33c9a8448088d2f486c5a3d3038f7586893293 Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Tue, 15 Feb 2022 16:11:40 +0100 Subject: [PATCH 3/4] Remove arguments from helm template make target --- Makefile | 6 +++--- hack/bin/helm-template.sh | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4ea6e2e0e7..07aa30c68d 100644 --- a/Makefile +++ b/Makefile @@ -522,7 +522,7 @@ kind-restart-%: .local/kind-kubeconfig # hack/helm_vars (what CI uses) as overrrides, if available. This allows debugging helm # templating issues without actually installing anything, and without needing # access to a kubernetes cluster. e.g.: -# make helm-template-wire-server -helm-template-%: clean-charts charts-integration - ./hack/bin/helm-template.sh $(*) +# make helm-template +helm-template: clean-charts charts-integration + ./hack/bin/helm-template.sh diff --git a/hack/bin/helm-template.sh b/hack/bin/helm-template.sh index 3587aa94f0..2d482db1f1 100755 --- a/hack/bin/helm-template.sh +++ b/hack/bin/helm-template.sh @@ -1,10 +1,13 @@ #!/usr/bin/env bash -# This script can be used to template a helm chart with values filled in from +# This script can be used to render all helm charts with values filled in from # hack/helm_vars as overrrides, if available. This allows debugging helm # templating issues without actually installing anything, and without needing # access to a kubernetes cluster +# Call the script directly (optionally with `--skip-deps`), or via the +# `helm-template` make target. + set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" From f4efa775c057bd090319f60cbdc1d8fefea66111 Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Wed, 16 Feb 2022 13:43:48 +0100 Subject: [PATCH 4/4] Set one more variable in the template script --- hack/bin/helm-template.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hack/bin/helm-template.sh b/hack/bin/helm-template.sh index 2d482db1f1..cae6ed599a 100755 --- a/hack/bin/helm-template.sh +++ b/hack/bin/helm-template.sh @@ -13,9 +13,11 @@ set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" TOP_LEVEL="$DIR/../.." CHARTS_DIR="${TOP_LEVEL}/.local/charts" -: "${FEDERATION_DOMAIN:=example.com}" +: "${FEDERATION_DOMAIN_BASE:=example.com}" +: "${FEDERATION_DOMAIN:=namespace1.example.com}" : "${NAMESPACE:=namespace1}" +export FEDERATION_DOMAIN_BASE export FEDERATION_DOMAIN export NAMESPACE