mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-21 08:21:35 +02:00
Merge remote-tracking branch 'origin/main' into fix-include-needs-transitive-1003
Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
This commit is contained in:
@@ -96,6 +96,7 @@ ${kubectl} create namespace ${test_ns} || fail "Could not create namespace ${tes
|
||||
|
||||
# TEST CASES----------------------------------------------------------------------------------------------------------
|
||||
|
||||
. ${dir}/test-cases/chart-deps-condition.sh
|
||||
. ${dir}/test-cases/fetch-forl-local-chart.sh
|
||||
. ${dir}/test-cases/suppress-output-line-regex.sh
|
||||
. ${dir}/test-cases/chartify-jsonPatches-and-strategicMergePatches.sh
|
||||
@@ -107,6 +108,7 @@ ${kubectl} create namespace ${test_ns} || fail "Could not create namespace ${tes
|
||||
. ${dir}/test-cases/skip-diff-output.sh
|
||||
. ${dir}/test-cases/v1-subhelmfile-multi-bases-with-array-values.sh
|
||||
. ${dir}/test-cases/kustomized-fetch.sh
|
||||
. ${dir}/test-cases/issue-2503-kustomize-fetch.sh
|
||||
. ${dir}/test-cases/regression.sh
|
||||
. ${dir}/test-cases/secretssops.sh
|
||||
. ${dir}/test-cases/yaml-overwrite.sh
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
chart_deps_condition_input_dir="${cases_dir}/chart-deps-condition/input"
|
||||
|
||||
chart_deps_condition_tmp=$(mktemp -d)
|
||||
actual=${chart_deps_condition_tmp}/actual.yaml
|
||||
expected="${cases_dir}/chart-deps-condition/output/template"
|
||||
|
||||
test_start "chart with dependencies and condition"
|
||||
|
||||
# --concurrency 1 is a workaround for https://github.com/helmfile/helmfile/issues/2502
|
||||
${helmfile} -f ${chart_deps_condition_input_dir}/helmfile.yaml template --skip-deps --concurrency 1 > ${actual} || fail "\"helmfile template\" shouldn't fail"
|
||||
./dyff between -bs ${expected} ${actual} || fail "\"helmfile template\" should be consistent"
|
||||
|
||||
test_pass "chart with dependencies and condition"
|
||||
@@ -0,0 +1,14 @@
|
||||
dependencies:
|
||||
- name: subchart1
|
||||
repository: file://charts/subchart1
|
||||
condition: subchart1.install
|
||||
version: 1.0.0
|
||||
- name: subchart2
|
||||
repository: file://charts/subchart2
|
||||
version: 2.0.0
|
||||
apiVersion: v2
|
||||
appVersion: 3.0.0
|
||||
description: Test helm charts dependencies
|
||||
name: testchartsdeps
|
||||
type: application
|
||||
version: 3.0.0
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: subchart1
|
||||
description: Test sub helm chart 1
|
||||
type: application
|
||||
version: 1.0.0
|
||||
appVersion: "1.0.0"
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub1
|
||||
data:
|
||||
sub: 1
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: subchart2
|
||||
description: Test sub helm chart 2
|
||||
type: application
|
||||
version: 2.0.0
|
||||
appVersion: "2.0.0"
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub2
|
||||
data:
|
||||
sub: 2
|
||||
@@ -0,0 +1,2 @@
|
||||
subchart1:
|
||||
install: true
|
||||
@@ -0,0 +1,57 @@
|
||||
# Test that subcharts 'condition' is working properly
|
||||
|
||||
releases:
|
||||
# Releases without patches, so not using chartify
|
||||
- name: testdefault
|
||||
chart: ./chart
|
||||
namespace: testdefault
|
||||
- name: testinstallfalse
|
||||
chart: ./chart
|
||||
namespace: testinstallfalse
|
||||
values:
|
||||
- subchart1:
|
||||
install: false
|
||||
- name: testinstalltrue
|
||||
chart: ./chart
|
||||
namespace: testcinstalltrue
|
||||
values:
|
||||
- subchart1:
|
||||
install: true
|
||||
|
||||
# Releases with patches, so using chartify
|
||||
- name: testchartifydefault
|
||||
chart: ./chart
|
||||
namespace: testchartifydefault
|
||||
strategicMergePatches:
|
||||
- apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub2
|
||||
data:
|
||||
sub: 42
|
||||
- name: testchartifyinstallfalse
|
||||
chart: ./chart
|
||||
namespace: testchartifyinstallfalse
|
||||
values:
|
||||
- subchart1:
|
||||
install: false
|
||||
strategicMergePatches:
|
||||
- apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub2
|
||||
data:
|
||||
sub: 42
|
||||
- name: testchartifyinstalltrue
|
||||
chart: ./chart
|
||||
namespace: testchartifyinstalltrue
|
||||
values:
|
||||
- subchart1:
|
||||
install: true
|
||||
strategicMergePatches:
|
||||
- apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub2
|
||||
data:
|
||||
sub: 42
|
||||
@@ -0,0 +1,86 @@
|
||||
---
|
||||
# Source: testchartsdeps/charts/subchart1/templates/cm.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub1
|
||||
data:
|
||||
sub: 1
|
||||
---
|
||||
# Source: testchartsdeps/charts/subchart2/templates/cm.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub2
|
||||
data:
|
||||
sub: 2
|
||||
|
||||
---
|
||||
# Source: testchartsdeps/charts/subchart2/templates/cm.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub2
|
||||
data:
|
||||
sub: 2
|
||||
|
||||
---
|
||||
# Source: testchartsdeps/charts/subchart1/templates/cm.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub1
|
||||
data:
|
||||
sub: 1
|
||||
---
|
||||
# Source: testchartsdeps/charts/subchart2/templates/cm.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub2
|
||||
data:
|
||||
sub: 2
|
||||
|
||||
---
|
||||
# Source: testchartsdeps/templates/patched_resources.yaml
|
||||
apiVersion: v1
|
||||
data:
|
||||
sub: 1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub1
|
||||
---
|
||||
# Source: testchartsdeps/templates/patched_resources.yaml
|
||||
apiVersion: v1
|
||||
data:
|
||||
sub: 42
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub2
|
||||
|
||||
---
|
||||
# Source: testchartsdeps/templates/patched_resources.yaml
|
||||
apiVersion: v1
|
||||
data:
|
||||
sub: 42
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub2
|
||||
|
||||
---
|
||||
# Source: testchartsdeps/templates/patched_resources.yaml
|
||||
apiVersion: v1
|
||||
data:
|
||||
sub: 1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub1
|
||||
---
|
||||
# Source: testchartsdeps/templates/patched_resources.yaml
|
||||
apiVersion: v1
|
||||
data:
|
||||
sub: 42
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: testsub2
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
issue_2503_input_dir="${cases_dir}/issue-2503-kustomize-fetch/input"
|
||||
|
||||
test_start "issue-2503 helmfile fetch with kustomization directory"
|
||||
|
||||
info "Testing helmfile fetch with local kustomization directory (issue #2503)"
|
||||
|
||||
for i in $(seq 3); do
|
||||
info "Testing helmfile fetch with kustomization #$i"
|
||||
issue_2503_tmp=$(mktemp -d)
|
||||
${helmfile} -f ${issue_2503_input_dir}/helmfile.yaml fetch --output-dir ${issue_2503_tmp} || fail "\"helmfile fetch\" shouldn't fail with kustomization directory"
|
||||
rm -fr ${issue_2503_tmp}
|
||||
done
|
||||
|
||||
test_pass "issue-2503 helmfile fetch with kustomization directory"
|
||||
@@ -0,0 +1,3 @@
|
||||
releases:
|
||||
- name: test-kustomize
|
||||
chart: ./kustomize
|
||||
@@ -0,0 +1,6 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: test-configmap
|
||||
data:
|
||||
key: value
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- configmap.yaml
|
||||
Reference in New Issue
Block a user