Skip to content

Commit 85a8f2d

Browse files
authored
fix: only get v1 sandbox image (#6834)
Signed-off-by: machichima <nary12321@gmail.com>
1 parent fba30ad commit 85a8f2d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

flytectl/pkg/github/githubutil.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const (
2525
flyte = "flyte"
2626
flytectl = "flytectl"
2727
sandboxSupportedVersion = "v0.10.0"
28+
sandboxMaxVersion = "v2.0.0"
2829
flytectlRepository = "github.com/flyteorg/flyte"
2930
commonMessage = "\n A new release of flytectl is available: %s → %s \n"
3031
brewMessage = "To upgrade, run: brew update && brew upgrade flytectl \n"
@@ -129,6 +130,17 @@ func GetSandboxImageSha(tag string, pre bool, g GHRepoService) (string, string,
129130
return "", release.GetTagName(), err
130131
}
131132
for _, v := range releases {
133+
tagName := v.GetTagName()
134+
135+
// Skip versions >= sandboxMaxVersion (v2.x and above)
136+
// flytectl only supports flyte v1
137+
isLessThan, err := util.IsVersionGreaterThan(sandboxMaxVersion, tagName)
138+
if err == nil && !isLessThan {
139+
// tagName >= sandboxMaxVersion, skip it
140+
logger.Debugf(context.Background(), "skipping release %s (>= %s)", tagName, sandboxMaxVersion)
141+
continue
142+
}
143+
132144
// When pre-releases are allowed, simply choose the latest release
133145
if pre {
134146
release = v

0 commit comments

Comments
 (0)