diff --git a/helm-git-plugin.sh b/helm-git-plugin.sh index 9afbc4a2..722017c2 100755 --- a/helm-git-plugin.sh +++ b/helm-git-plugin.sh @@ -299,6 +299,6 @@ main() { helm_index "$helm_target_path" "$helm_repo_uri" || error "Error while helm_index" - debug "helm index produced at $helm_target_file: $(cat "$helm_target_file")" + debug "helm index produced at $helm_target_file: $(tr -d '\0' < "$helm_target_file")" cat "$helm_target_file" } diff --git a/tests/05-helm-cli.bats b/tests/05-helm-cli.bats index ec2886f4..a4e80b04 100644 --- a/tests/05-helm-cli.bats +++ b/tests/05-helm-cli.bats @@ -79,3 +79,14 @@ load 'test-helper' run grep wp-cff9c65 "$HELM_HOME/repository/repositories.yaml" [ -n "$output" ] } + +@test "helm_cli template example-chart with remote values" { + run helm_init "$HELM_HOME" + [ $status = 0 ] + run "$HELM_BIN" plugin install "$HELM_GIT_DIRNAME" + [ $status = 0 ] + run "$HELM_BIN" template "${HELM_GIT_DIRNAME}/tests/fixtures/prebuilt-chart/example-chart-0.1.0.tgz" -f "git+https://github.com/aslafy-z/helm-git@tests/fixtures/example-chart/extra-values.yaml?ref=${FIXTURES_GIT_BRANCH}" --output-dir "$HELM_GIT_OUTPUT" + [ $status = 0 ] + run grep -q "replicas: 999" "$HELM_GIT_OUTPUT/example-chart/templates/deployment.yaml" + [ $status = 0 ] +} diff --git a/tests/fixtures/example-chart/extra-values.yaml b/tests/fixtures/example-chart/extra-values.yaml new file mode 100644 index 00000000..bea69b32 --- /dev/null +++ b/tests/fixtures/example-chart/extra-values.yaml @@ -0,0 +1 @@ +replicaCount: 999