Skip to content

Commit 7d3a0d2

Browse files
johnduhartclaude
andauthored
fix(localstack): accept community-archive as a valid tag (#3601)
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 3e56fb9 commit 7d3a0d2

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

modules/localstack/localstack.go

Lines changed: 6 additions & 0 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,10 +34,15 @@ func isMinimumVersion(image string, minVersion string) bool {
3334
parts := strings.Split(strings.Split(image, "@")[0], ":")
3435
version := parts[len(parts)-1]
3536

37+
if slices.Contains(recentVersionTags, version) {
38+
return true
39+
}
40+
3641
if pos := strings.LastIndexByte(version, '-'); pos >= 0 {
3742
version = version[0:pos]
3843
}
3944

45+
// Re-check after stripping the arch suffix (e.g. "community-archive-amd64" -> "community-archive").
4046
if slices.Contains(recentVersionTags, version) {
4147
return true
4248
}

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)