Kong / CustomerSuccess

BSD 2-Clause "Simplified" License
4 stars 4 forks source link

Upgrade Version and not able to test the Url's #25

Open pridhviraj2602 opened 1 month ago

pridhviraj2602 commented 1 month ago

root@eric-VirtualBox:/home/eric/Documents/CustomerSuccess-main/tools# apt upgrade jq

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

jq is already the newest version (1.6-2.1ubuntu3).

Calculating upgrade... Done

Get more security updates through Ubuntu Pro with 'esm-apps' enabled:

imagemagick libopenexr25 libmagickcore-6.q16-6-extra libmagickwand-6.q16-6

imagemagick-6.q16 libmagickcore-6.q16-6 imagemagick-6-common libde265-0

Learn more about Ubuntu Pro at https://ubuntu.com/pro

The following packages have been kept back:

libfprint-2-2

0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

root@eric-VirtualBox:/home/eric/Documents/CustomerSuccess-main/tools# ./klcr.sh -i envs.json -o ./xc

jq version is below version 1.7, please upgrade to version 1.7 before continuing

pridhviraj2602 commented 1 month ago

It's just telling us to upgrade the version and not letting us test the scripts

dlamotta commented 1 month ago

Hi @pridhviraj2602 - and apt update in Ubuntu will pull 1.6. In my local Ubuntu machine, I had to manually download 1.7.1 to make it work.

linziee commented 1 month ago

@dlamotta $ jq --version jq-1.7 $ ./klcr.sh -i envs.json -o ./xc -k jq version is below version 1.7, please upgrade to version 1.7 before continuing

dlamotta commented 1 month ago

@linziee on version 2.3.1, you can comment out lines 643..648 and test. If the script works with 1.7, we'll create an issue and address it. I already see the extra 0 may not be returned when the version is 1.7, so it could be a small bug. Cc @dsglaser

dsglaser commented 1 month ago

Yep, looks like it wasn't handling if jq didn't return a tertiary version (i.e. 1.7.0). I'm working on a PR to handle it and should have it done by EOD. Thanks @linziee

linziee commented 1 month ago

@dlamotta Suggest these edits to section in lines 642 - 648. Had issues with comparing a string to an integer in the current version.

Check that jq is at version 1.7.0 or above

jq_ver=$(jq -V | grep -o '[0-9]+.[0-9]+' | head -1) jq_ver_major=$(echo $jq_ver | cut -d. -f1) jq_ver_minor=$(echo $jq_ver | cut -d. -f2)

if [[ "$jq_ver_major" -lt 1 ]] || { [[ "$jq_ver_major" -eq 1 ]] && [[ "$jq_ver_minor" -lt 7 ]]; }; then echo "jq version is below version 1.7, please upgrade to version 1.7 before continuing" exit 1 fi

dlamotta commented 1 month ago

@dsglaser please take a look at the suggestion by @linziee

dsglaser commented 1 month ago

@linziee

On my linux box, grep -o '[0-9]+.[0-9]+' isn't producing output unless I drop the '+'. it might be a difference in how grep is implemented between our two machines.

It might be simpler just to use cut:

jq_ver_major=jq -V | cut -f2 -d- | cut -d. -f1 jq_ver_minor=jq -V | cut -f2 -d- | cut -d. -f2

if [[ "$jq_ver_major" -lt 1 ]] || { [[ "$jq_ver_major" -eq 1 ]] && [[ "$jq_ver_minor" -lt 7 ]]; }; then echo "jq version is below version 1.7, please upgrade to version 1.7 before continuing" exit 1 fi

On Tue, Jul 2, 2024 at 9:17 AM David La Motta @.***> wrote:

@dsglaser please take a look at the suggestion by @linziee

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

dsglaser commented 1 month ago

I just submitted a PR to handle this, based on my comment above.