fix: catch that suffix comparison bug

This commit is contained in:
decentral1se 2021-08-09 15:05:03 +02:00
parent 8c998c0043
commit 19bcaca6e6
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 2 additions and 1 deletions

View File

@ -144,7 +144,7 @@ func (t Tag) IsCompatible(tag Tag) bool {
return false
}
if t.Suffix != "" && tag.Suffix == "" {
if t.Suffix != "" && tag.Suffix == "" || t.Suffix == "" && tag.Suffix != "" {
return false
}

View File

@ -599,6 +599,7 @@ func TestIsCompatible(t *testing.T) {
{"1.2.3", "1.2.0", true},
{"5-alpine", "6-alpine", true},
{"5-alpine", "6.5-alpine", false},
{"5", "5-alpine", false},
}
for _, p := range pairs {
p1, err := tagcmp.Parse(p.t1)