Skip to content

Commit 2f9b18c

Browse files
committed
release_dispatcher.sh: fix version array
The version variable is used as both an array and a scalar type in release_dispatcher.sh. When being set to a scalar value and previously being used as array, only the first array member is overwritten. This leads to erroneous build dispatches because versions are mixed up. We explicitly un-set the variable at the end of the version loop We also check the presence of <extension>:<version> pairs in the build array before adding new ones to prevent cases where "latest" and a pinned version are identical Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
1 parent b0ba2c4 commit 2f9b18c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

release_dispatcher.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ for image in "${images[@]}"; do
2626
version="${image#* }"
2727

2828
if [ "${version}" = "latest" ] ; then
29+
unset version
2930
mapfile -t version < <( ./bakery.sh list "${extension}" --latest true )
3031
fi
3132

@@ -38,14 +39,19 @@ for image in "${images[@]}"; do
3839
continue
3940
fi
4041

41-
echo "Build required. "
42-
build_required="true"
43-
builds+=( "${extension}:${v}" )
42+
if [[ " ${builds[@]} " != *" ${extension}:${v} "* ]] ; then
43+
echo "Build required. "
44+
build_required="true"
45+
builds+=( "${extension}:${v}" )
46+
else
47+
echo "Build already scheduled. "
48+
fi
4449
done
4550

4651
if [[ $build_required == true && " ${extensions[@]} " != *" ${extension} "* ]] ; then
4752
extensions+=( "${extension}" )
4853
fi
54+
unset version
4955
done
5056

5157
cat >> "${output}" <<EOF

0 commit comments

Comments
 (0)