Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(*): properly resolve versions in double-digit case #619

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
* Feat: enable FIPS mode by passing `KONG_TEST_FIPS` env variable
[#615](https://github.com/Kong/kong-pongo/pull/615).

* Fix: properly resolve Kong-versions in case of double digits, eg. 3.4.3.12
[#619](https://github.com/Kong/kong-pongo/pull/619).


---

## 2.12.0 released 16-Jul-2024
Expand Down
16 changes: 12 additions & 4 deletions assets/set_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,24 @@ function resolve_version {
if ((segments == 4)); then
# this is a 4 segment version, which means it is an EE version.
# For an EE version we need to resolve the last 2 segments
for entry in ${KONG_VERSIONS[*]}; do
if [[ "${KONG_VERSION:0:${#KONG_VERSION}-3}" == "${entry:0:${#entry}-3}" ]]; then
local pref1
pref1="$(echo "$KONG_VERSION" | awk -F'.' '{print $1"."$2"."}')"
for entry in ${KONG_EE_VERSIONS[*]}; do
local pref2
pref2="$(echo "$entry" | awk -F'.' '{print $1"."$2"."}')"
if [[ "$pref1" == "$pref2" ]]; then
# keep replacing, last one wins
new_version=$entry
fi
done;
else
# this should then be an OSS version
for entry in ${KONG_VERSIONS[*]}; do
if [[ "${KONG_VERSION:0:${#KONG_VERSION}-1}" == "${entry:0:${#entry}-1}" ]]; then
local pref1
pref1="$(echo "$KONG_VERSION" | awk -F'.' '{print $1"."$2"."}')"
for entry in ${KONG_CE_VERSIONS[*]}; do
local pref2
pref2="$(echo "$entry" | awk -F'.' '{print $1"."$2"."}')"
if [[ "$pref1" == "$pref2" ]]; then
# keep replacing, last one wins
new_version=$entry
fi
Expand Down
Loading