diff --git a/flytectl/pkg/github/githubutil.go b/flytectl/pkg/github/githubutil.go index 486e75845e..f76d7f7580 100644 --- a/flytectl/pkg/github/githubutil.go +++ b/flytectl/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 }