Skip to content

Commit 32f30dd

Browse files
Merge pull request #102 from SumoLogic/fix-latest-version
fix(install): Fix script to always install the latest stable version
2 parents c7b5dc8 + efbbae1 commit 32f30dd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

install-script/install.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,9 @@ function get_latest_version() {
456456

457457
# get latest version directly from website if there is no versions from api
458458
if [[ -z "${versions}" ]]; then
459-
curl --retry 5 --connect-timeout 5 --max-time 30 --retry-delay 0 --retry-max-time 150 -s https://github.com/SumoLogic/sumologic-otel-collector/releases | grep -oE '/SumoLogic/sumologic-otel-collector/releases/tag/(.*)"' | head -n 1 | sed 's%/SumoLogic/sumologic-otel-collector/releases/tag/v\([^"]*\)".*%\1%g'
459+
curl --retry 5 --connect-timeout 5 --max-time 30 --retry-delay 5 --retry-max-time 150 -s https://github.com/SumoLogic/sumologic-otel-collector/releases \
460+
| grep -Eo '/SumoLogic/sumologic-otel-collector/releases/tag/v[0-9]+\.[0-9]+\.[0-9]+-sumo-[0-9]+[^-]' \
461+
| head -n 1 | sed 's%/SumoLogic/sumologic-otel-collector/releases/tag/v\([^"]*\)".*%\1%g'
460462
else
461463
# sed 's/ /\n/g' converts spaces to new lines
462464
echo "${versions}" | sed 's/ /\n/g' | head -n 1
@@ -489,7 +491,7 @@ function get_versions() {
489491
}
490492

491493
function get_package_versions() {
492-
# returns empty in case we exceeded github rate limit
494+
# returns empty in case we exceeded github rate limit. This can happen if we are running this script too many times in a short period.
493495
if [[ "$(github_rate_limit)" == "0" ]]; then
494496
return
495497
fi

0 commit comments

Comments
 (0)