Chartify v0.20.8 update (#1908)

* fix: use chartify v0.20.8 with relevant fix for import-values

Signed-off-by: GitHub <noreply@github.com>

* chore: add test

Signed-off-by: GitHub <noreply@github.com>

---------

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
S Code Man 2025-02-05 21:42:05 +08:00 committed by GitHub
parent 75651801a6
commit 8afffa5c98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 35 additions and 4 deletions

2
go.mod
View File

@ -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

4
go.sum
View File

@ -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=

View File

@ -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 -----------------------------------------------------------------------------------------------------------

View File

@ -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"

View File

@ -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"