From 8afffa5c984513b96ba6065ad22ad0f0e54e2590 Mon Sep 17 00:00:00 2001 From: S Code Man <30977678+scodeman@users.noreply.github.com> Date: Wed, 5 Feb 2025 21:42:05 +0800 Subject: [PATCH] Chartify v0.20.8 update (#1908) * fix: use chartify v0.20.8 with relevant fix for import-values Signed-off-by: GitHub * chore: add test Signed-off-by: GitHub --------- Signed-off-by: GitHub --- go.mod | 2 +- go.sum | 4 ++-- test/integration/run.sh | 5 ++++- test/integration/test-cases/issue-1893.sh | 8 ++++++++ .../test-cases/issue-1893/input/helmfile.yaml | 20 +++++++++++++++++++ 5 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 test/integration/test-cases/issue-1893.sh create mode 100644 test/integration/test-cases/issue-1893/input/helmfile.yaml diff --git a/go.mod b/go.mod index a04ccb4e..9f53c311 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/gosuri/uitable v0.0.4 github.com/hashicorp/go-getter v1.7.8 github.com/hashicorp/hcl/v2 v2.23.0 - github.com/helmfile/chartify v0.20.7 + github.com/helmfile/chartify v0.20.8 github.com/helmfile/vals v0.39.0 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.6 diff --git a/go.sum b/go.sum index 0f980776..023bf3e9 100644 --- a/go.sum +++ b/go.sum @@ -1214,8 +1214,8 @@ github.com/hashicorp/jsonapi v1.3.1 h1:GtPvnmcWgYwCuDGvYT5VZBHcUyFdq9lSyCzDjn1Dd github.com/hashicorp/jsonapi v1.3.1/go.mod h1:kWfdn49yCjQvbpnvY1dxxAuAFzISwrrMDQOcu6NsFoM= github.com/hashicorp/vault/api v1.15.0 h1:O24FYQCWwhwKnF7CuSqP30S51rTV7vz1iACXE/pj5DA= github.com/hashicorp/vault/api v1.15.0/go.mod h1:+5YTO09JGn0u+b6ySD/LLVf8WkJCPLAL2Vkmrn2+CM8= -github.com/helmfile/chartify v0.20.7 h1:aOUvSFHrT/0LOUDz1Mcg2TDBtpvXBrZSYnBZvwmqruo= -github.com/helmfile/chartify v0.20.7/go.mod h1:mWN+sWWf+lnA225jZIqqgpwbGjiT3NAQHGCm5vdC0zw= +github.com/helmfile/chartify v0.20.8 h1:vRzQ6Mb8OEncoA3K5RYtup5JVzy5waUSK24MBXK3CTY= +github.com/helmfile/chartify v0.20.8/go.mod h1:mWN+sWWf+lnA225jZIqqgpwbGjiT3NAQHGCm5vdC0zw= github.com/helmfile/vals v0.39.0 h1:8V1NN4ac7SHFCjq3tlTO8zHKFQ26DY9qVGRKPhYDHoE= github.com/helmfile/vals v0.39.0/go.mod h1:GoA8SSsiX661IFaG4E5O+FSPl+hW2MLyWR9zxzAjR+A= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= diff --git a/test/integration/run.sh b/test/integration/run.sh index b1548856..f3d9bb5f 100755 --- a/test/integration/run.sh +++ b/test/integration/run.sh @@ -28,6 +28,7 @@ export HELM_HOME="${HELM_DATA_HOME}" export HELM_PLUGINS="${HELM_DATA_HOME}/plugins" export HELM_CONFIG_HOME="${helm_dir}/config" HELM_DIFF_VERSION="${HELM_DIFF_VERSION:-3.9.14}" +HELM_GIT_VERSION="${HELM_GIT_VERSION:-1.3.0}" HELM_SECRETS_VERSION="${HELM_SECRETS_VERSION:-3.15.0}" export GNUPGHOME="${PWD}/${dir}/.gnupg" export SOPS_PGP_FP="B2D6D7BBEC03B2E66571C8C00AD18E16CFDEF700" @@ -70,7 +71,8 @@ set -e trap cleanup EXIT info "Using namespace: ${test_ns}" info "Using Helm version:" $(${helm} version --short | grep -o 'v[0-9.]\+') -${helm} plugin ls | grep diff || ${helm} plugin install https://github.com/databus23/helm-diff --version v${HELM_DIFF_VERSION} +${helm} plugin ls | grep "^diff" || ${helm} plugin install https://github.com/databus23/helm-diff --version v${HELM_DIFF_VERSION} +${helm} plugin ls | grep "^helm-git" || ${helm} plugin install https://github.com/aslafy-z/helm-git --version v${HELM_GIT_VERSION} info "Using Kustomize version: $(kustomize version --short | grep -o 'v[0-9.]\+')" ${kubectl} get namespace ${test_ns} &> /dev/null && warn "Namespace ${test_ns} exists, from a previous test run?" ${kubectl} create namespace ${test_ns} || fail "Could not create namespace ${test_ns}" @@ -98,6 +100,7 @@ ${kubectl} create namespace ${test_ns} || fail "Could not create namespace ${tes . ${dir}/test-cases/deps-kustomization-i-1402.sh . ${dir}/test-cases/hcl-secrets.sh . ${dir}/test-cases/issue-1749.sh +. ${dir}/test-cases/issue-1893.sh # ALL DONE ----------------------------------------------------------------------------------------------------------- diff --git a/test/integration/test-cases/issue-1893.sh b/test/integration/test-cases/issue-1893.sh new file mode 100644 index 00000000..0306275b --- /dev/null +++ b/test/integration/test-cases/issue-1893.sh @@ -0,0 +1,8 @@ +issue_1893_input_dir="${cases_dir}/issue-1893/input" +helmfile_real="$(pwd)/${helmfile}" + +test_start "issue 1893 helmfile template" +cd "${issue_1893_input_dir}" +${helmfile_real} template || fail "\"issue 1893 helmfile template shouldn't fail" +cd - +test_pass "issue 1893 helmfile template" \ No newline at end of file diff --git a/test/integration/test-cases/issue-1893/input/helmfile.yaml b/test/integration/test-cases/issue-1893/input/helmfile.yaml new file mode 100644 index 00000000..f52eaef8 --- /dev/null +++ b/test/integration/test-cases/issue-1893/input/helmfile.yaml @@ -0,0 +1,20 @@ +--- +repositories: +- name: chartify-testdata + url: git+https://github.com/helmfile/chartify@testdata/charts/importvalues?ref=master + +releases: +- name: importvalues + chart: chartify-testdata/importvalues + version: 0.1.0 + transformers: + - apiVersion: builtin + kind: ValueAddTransformer + metadata: + name: add-annotation-issue + targets: + - fieldPath: metadata/annotations/issue + selector: + kind: ConfigMap + name: importvalues-imported-values + value: "1893" \ No newline at end of file