Skip to content

Commit cd95678

Browse files
johnduhartclaude
andcommitted
fix(localstack): accept community-archive as a valid tag
Check the tag against recentVersionTags before stripping hyphen suffixes, so that tags containing hyphens like community-archive are correctly recognized as up-to-date versions. Fixes #3592 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ea9748b commit cd95678

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

modules/localstack/localstack.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const (
2323
)
2424

2525
var recentVersionTags = []string{
26+
"community-archive",
2627
"latest",
2728
"s3",
2829
"s3-latest",
@@ -33,14 +34,14 @@ func isMinimumVersion(image string, minVersion string) bool {
3334
parts := strings.Split(strings.Split(image, "@")[0], ":")
3435
version := parts[len(parts)-1]
3536

36-
if pos := strings.LastIndexByte(version, '-'); pos >= 0 {
37-
version = version[0:pos]
38-
}
39-
4037
if slices.Contains(recentVersionTags, version) {
4138
return true
4239
}
4340

41+
if pos := strings.LastIndexByte(version, '-'); pos >= 0 {
42+
version = version[0:pos]
43+
}
44+
4445
if !strings.HasPrefix(version, "v") {
4546
version = "v" + version
4647
}

modules/localstack/localstack_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ func TestIsLegacyVersion(t *testing.T) {
8787
want bool
8888
}{
8989
{"foo", true},
90+
{"community-archive", false},
91+
{"community-archive-amd64", false},
9092
{"latest", false},
9193
{"latest-amd64", false},
9294
{"s3-latest", false},
@@ -124,6 +126,8 @@ func TestIsMinimumVersion2(t *testing.T) {
124126
want bool
125127
}{
126128
{"foo", false},
129+
{"community-archive", true},
130+
{"community-archive-amd64", true},
127131
{"latest", true},
128132
{"latest-amd64", true},
129133
{"s3-latest", true},

0 commit comments

Comments
 (0)