Skip to content

Commit 26d834a

Browse files
authored
fix: Remove checksum before parsing version
1 parent 70d92b9 commit 26d834a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

modules/localstack/localstack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var recentVersionTags = []string{
3030
}
3131

3232
func isMinimumVersion(image string, minVersion string) bool {
33-
parts := strings.Split(image, ":")
33+
parts := strings.Split(strings.Split(image, "@")[0], ":")
3434
version := parts[len(parts)-1]
3535

3636
if pos := strings.LastIndexByte(version, '-'); pos >= 0 {

modules/localstack/localstack_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func TestIsLegacyVersion(t *testing.T) {
108108
{"1-amd64", false},
109109
{"1.0", false},
110110
{"1.0-amd64", false},
111+
{"4.3.0@sha256:f3cb1a79f3add997575e859c3a2808e6dae4b0de836661de255baa2b576868f8", false},
111112
}
112113

113114
for _, tt := range tests {
@@ -148,6 +149,7 @@ func TestIsMinimumVersion2(t *testing.T) {
148149
{"2.1-amd64", true},
149150
{"3", true},
150151
{"3-amd64", true},
152+
{"4.3.0@sha256:f3cb1a79f3add997575e859c3a2808e6dae4b0de836661de255baa2b576868f8", true},
151153
}
152154

153155
for _, tt := range tests {

0 commit comments

Comments
 (0)