mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-20 21:27:06 +02:00
fix chartify with non-chart dir (#1105)
* fix chartify with non-chart dir Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
@@ -76,6 +76,7 @@ ${kubectl} create namespace ${test_ns} || fail "Could not create namespace ${tes
|
||||
|
||||
# TEST CASES----------------------------------------------------------------------------------------------------------
|
||||
|
||||
. ${dir}/test-cases/chartify-with-non-chart-dir.sh
|
||||
. ${dir}/test-cases/helmfile-double-fetch.sh
|
||||
. ${dir}/test-cases/skip-diff-output.sh
|
||||
. ${dir}/test-cases/v1-subhelmfile-multi-bases-with-array-values.sh
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
chartify_with_non_chart_dirt_input_dir="${cases_dir}/chartify-with-non-chart-dir/input"
|
||||
chartify_with_non_chart_dirt_output_dir="${cases_dir}/chartify-with-non-chart-dir/output"
|
||||
|
||||
chartify_with_non_chart_dirt_tmp=$(mktemp -d)
|
||||
chartify_with_non_chart_dirt_reverse=${chartify_with_non_chart_dirt_tmp}/chartify.with.non.chart.build.yaml
|
||||
|
||||
case_title="chartify with non-chart dir"
|
||||
|
||||
diff_out_file=${chartify_with_non_chart_dirt_output_dir}/diff-result
|
||||
|
||||
|
||||
if [[ $EXTRA_HELMFILE_FLAGS == *--enable-live-output* ]]; then
|
||||
diff_out_file=${chartify_with_non_chart_dirt_output_dir}/diff-result-live
|
||||
fi
|
||||
|
||||
test_start "$case_title"
|
||||
info "Comparing ${case_title} diff for output ${chartify_with_non_chart_dirt_reverse} with ${diff_out_file}"
|
||||
for i in $(seq 10); do
|
||||
info "Comparing chartify-with-non-chart-dir diff log #$i"
|
||||
${helmfile} -f ${chartify_with_non_chart_dirt_input_dir}/helmfiles/helmfile.yaml diff | grep -v "^Comparing release" > ${chartify_with_non_chart_dirt_reverse} || fail "\"helmfile diff\" shouldn't fail"
|
||||
diff -u ${diff_out_file} ${chartify_with_non_chart_dirt_reverse} || fail "\"helmfile diff\" should be consistent"
|
||||
echo code=$?
|
||||
done
|
||||
test_pass "$case_title"
|
||||
@@ -0,0 +1,3 @@
|
||||
releases:
|
||||
- name: manifests
|
||||
chart: ../manifests
|
||||
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: configmap
|
||||
data:
|
||||
foo: "bar"
|
||||
bar: "baz"
|
||||
@@ -0,0 +1,18 @@
|
||||
********************
|
||||
|
||||
Release was not present in Helm. Diff will show entire contents as new.
|
||||
|
||||
********************
|
||||
helmfile-tests, configmap, ConfigMap (v1) has been added:
|
||||
-
|
||||
+ # Source: manifests/templates/configmap.yaml
|
||||
+ # Source: manifests/templates/configmap.yaml
|
||||
+ apiVersion: v1
|
||||
+ kind: ConfigMap
|
||||
+ metadata:
|
||||
+ name: configmap
|
||||
+ namespace: helmfile-tests
|
||||
+ data:
|
||||
+ foo: "bar"
|
||||
+ bar: "baz"
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
********************
|
||||
|
||||
Release was not present in Helm. Diff will show entire contents as new.
|
||||
|
||||
********************
|
||||
helmfile-tests, configmap, ConfigMap (v1) has been added:
|
||||
-
|
||||
+ # Source: manifests/templates/configmap.yaml
|
||||
+ # Source: manifests/templates/configmap.yaml
|
||||
+ apiVersion: v1
|
||||
+ kind: ConfigMap
|
||||
+ metadata:
|
||||
+ name: configmap
|
||||
+ namespace: helmfile-tests
|
||||
+ data:
|
||||
+ foo: "bar"
|
||||
+ bar: "baz"
|
||||
@@ -0,0 +1 @@
|
||||
https://github.com/helmfile/helmfile/issues/1103
|
||||
Reference in New Issue
Block a user