fix: resolve env_file variable interpolation issues by adding support for and default syntax

This commit is contained in:
yuefanxiao
2025-05-08 01:23:08 +08:00
parent 1b29e031e3
commit 22d9233f8b
9 changed files with 276 additions and 20 deletions
+8
View File
@@ -282,6 +282,14 @@ k8s_output="$KOMPOSE_ROOT/script/test/fixtures/compose-env-no-interpolation/outp
convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1
convert::expect_success "$os_cmd" "$os_output" || exit 1
# Test configmap generated by env_file with variable interpolation
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/env-lookup/compose.yaml convert --stdout --with-kompose-annotation=false"
os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/env-lookup/compose.yaml convert --stdout --with-kompose-annotation=false"
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/env-lookup/output-k8s.yaml"
os_output="$KOMPOSE_ROOT/script/test/fixtures/env-lookup/output-os.yaml"
convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1
convert::expect_success_and_warning "$os_cmd" "$os_output" || exit 1
# Test support for subpath volume
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/vols-subpath/compose.yaml convert --stdout --with-kompose-annotation=false"
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/vols-subpath/output-k8s.yaml"