diff --git a/releasenotes/notes/fix-if-condition-791277d5b3aae6fe.yaml b/releasenotes/notes/fix-if-condition-791277d5b3aae6fe.yaml new file mode 100644 index 00000000..0e6a738e --- /dev/null +++ b/releasenotes/notes/fix-if-condition-791277d5b3aae6fe.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix condition that check the file extension with packer build script. + The condition is skipped when long names ex: mininet-ovs-2.8.pkr.hcl diff --git a/shell/packer-build.sh b/shell/packer-build.sh index 7dd2434b..3f58021f 100644 --- a/shell/packer-build.sh +++ b/shell/packer-build.sh @@ -53,7 +53,7 @@ export PACKER_LOG="yes" export PACKER_LOG_PATH="$PACKER_BUILD_LOG" # download plugins only for HCL format -if [[ "${template_file#*.}" == "pkr.hcl" ]]; then +if [[ "${template_file#*.}" =~ .*pkr.hcl ]]; then echo "packer init ${template_file} ..." packer.io init "${template_file}" fi