Skip to content

Commit

Permalink
Fix: if condition to check file ext
Browse files Browse the repository at this point in the history
Fix condition to check the file extension with packer build script.
The packer init steps gets skipped when the condition fails
with some filenames ex: mininet-ovs-2.8.pkr.hcl.

Issue: RELENG-5574
Change-Id: I91b3b6270c62ee3a2c8f28c25be22b408657d840
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
  • Loading branch information
askb committed Oct 2, 2024
1 parent 72fac95 commit 377006d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions releasenotes/notes/fix-if-condition-791277d5b3aae6fe.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion shell/packer-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 377006d

Please sign in to comment.