Skip to content

Commit 72e7160

Browse files
authored
Fix chartify regression of missing chart dependencies (roboll#1869)
* Fix chartify regression of missing chart dependencies Fixes roboll#1867 * Add integration test cases for issues roboll#1857 and roboll#1867
1 parent 0d4adfe commit 72e7160

File tree

5 files changed

+60
-1
lines changed

5 files changed

+60
-1
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ require (
2828
github.com/spf13/cobra v1.1.1
2929
github.com/tatsushid/go-prettytable v0.0.0-20141013043238-ed2d14c29939
3030
github.com/urfave/cli v1.22.5
31-
github.com/variantdev/chartify v0.8.6
31+
github.com/variantdev/chartify v0.8.9
3232
github.com/variantdev/dag v1.0.0
3333
github.com/variantdev/vals v0.14.0
3434
go.uber.org/multierr v1.6.0

go.sum

+4
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,10 @@ github.com/variantdev/chartify v0.8.5 h1:yAw2+IxftPDR5A2/vr97Y6DR1U/2lJCHxfp40DB
630630
github.com/variantdev/chartify v0.8.5/go.mod h1:qF4XzQlkfH/6k2jAi1hLas+lK4zSCa8kY+r5JdmLA68=
631631
github.com/variantdev/chartify v0.8.6 h1:8WIJ/79qHg4cobFhZsA7VDyvLp0+W3O9SI31LlDnyOM=
632632
github.com/variantdev/chartify v0.8.6/go.mod h1:qF4XzQlkfH/6k2jAi1hLas+lK4zSCa8kY+r5JdmLA68=
633+
github.com/variantdev/chartify v0.8.8 h1:dsQyEfoSexCOPmGTSHIWYUuGkArN53B+43qTMfE7xU0=
634+
github.com/variantdev/chartify v0.8.8/go.mod h1:qF4XzQlkfH/6k2jAi1hLas+lK4zSCa8kY+r5JdmLA68=
635+
github.com/variantdev/chartify v0.8.9 h1:kECyWario6UOShilDThKfuvk+FhXWjlFod/Cg/wTmVs=
636+
github.com/variantdev/chartify v0.8.9/go.mod h1:qF4XzQlkfH/6k2jAi1hLas+lK4zSCa8kY+r5JdmLA68=
633637
github.com/variantdev/dag v0.0.0-20191028002400-bb0b3c785363 h1:KrfQBEUn+wEOQ/6UIfoqRDvn+Q/wZridQ7t0G1vQqKE=
634638
github.com/variantdev/dag v0.0.0-20191028002400-bb0b3c785363/go.mod h1:pH1TQsNSLj2uxMo9NNl9zdGy01Wtn+/2MT96BrKmVyE=
635639
github.com/variantdev/dag v1.0.0 h1:7SFjATxHtrYV20P3tx53yNDBMegz6RT4jv8JPHqAHdM=

test/integration/issue.1857.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
repositories:
2+
- name: prometheus-community
3+
url: https://prometheus-community.github.io/helm-charts
4+
5+
releases:
6+
- name: prometheus-operator-k8s-test
7+
chart: prometheus-community/kube-prometheus-stack
8+
namespace: monitoring
9+
forceNamespace: monitoring
10+
version: 15.4.6
11+
labels:
12+
component: test-upg
13+
values:
14+
- nameOverride: k8s
15+
fullnameOverride: prometheus-k8s
16+
global:
17+
imagePullSecrets:
18+
- name: regsecret
19+
alertmanager:
20+
enabled: false
21+
grafana:
22+
enabled: {{ .Values.grafanaEnabled }}

test/integration/issue.1867.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
repositories:
2+
- name: bitnami
3+
url: https://charts.bitnami.com/bitnami
4+
5+
releases:
6+
- name: elasticsearch
7+
chart: bitnami/elasticsearch
8+
version: 15.2.2
9+
jsonPatches:
10+
- target:
11+
version: v1
12+
kind: StatefulSet
13+
name: elasticsearch-master
14+
patch:
15+
- op: add
16+
path: /spec/template/spec/containers/0/volumeMounts/0/subPathExpr
17+
value: elasticsearch/$(MY_POD_NAME)
18+

test/integration/run.sh

+15
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,21 @@ info "Ensuring \"helmfile template\" output does contain only YAML docs"
150150

151151
test_pass "happypath"
152152

153+
test_start "regression tests"
154+
155+
if [[ helm_major_version -eq 3 ]]; then
156+
info "https://github.com/roboll/helmfile/issues/1857"
157+
(${helmfile} -f ${dir}/issue.1857.yaml --state-values-set grafanaEnabled=true template | grep grafana 1>/dev/null) || fail "\"helmfile template\" shouldn't include grafana"
158+
! (${helmfile} -f ${dir}/issue.1857.yaml --state-values-set grafanaEnabled=false template | grep grafana) || fail "\"helmfile template\" shouldn't include grafana"
159+
160+
info "https://github.com/roboll/helmfile/issues/1867"
161+
(${helmfile} -f ${dir}/issue.1867.yaml template 1>/dev/null) || fail "\"helmfile template\" shouldn't fail"
162+
else
163+
info "There are no regression tests for helm 2 because all the target charts have dropped helm 2 support."
164+
fi
165+
166+
test_pass "regression tests"
167+
153168
if [[ helm_major_version -eq 3 ]]; then
154169
export VAULT_ADDR=http://127.0.0.1:8200
155170
export VAULT_TOKEN=toor

0 commit comments

Comments
 (0)