From e5e63bad2cc60e8da79523f3aca272b16dc792a3 Mon Sep 17 00:00:00 2001 From: Jeev B Date: Sat, 27 May 2023 21:20:06 -0700 Subject: [PATCH] When preleases are allowed for demo sandbox, simply choose the latest release (#407) Signed-off-by: Jeev B --- pkg/github/githubutil.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/github/githubutil.go b/pkg/github/githubutil.go index 486e75845e..f76d7f7580 100644 --- a/pkg/github/githubutil.go +++ b/pkg/github/githubutil.go @@ -123,10 +123,11 @@ func GetSandboxImageSha(tag string, pre bool, g GHRepoService) (string, string, return "", release.GetTagName(), err } for _, v := range releases { - if *v.Prerelease && pre { + // When pre-releases are allowed, simply choose the latest release + if pre { release = v break - } else if !*v.Prerelease && !pre { + } else if !*v.Prerelease { release = v break }