forked from coop-cloud/tagcmp
fix: catch that suffix comparison bug
This commit is contained in:
parent
8c998c0043
commit
19bcaca6e6
|
@ -144,7 +144,7 @@ func (t Tag) IsCompatible(tag Tag) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if t.Suffix != "" && tag.Suffix == "" {
|
if t.Suffix != "" && tag.Suffix == "" || t.Suffix == "" && tag.Suffix != "" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -599,6 +599,7 @@ func TestIsCompatible(t *testing.T) {
|
||||||
{"1.2.3", "1.2.0", true},
|
{"1.2.3", "1.2.0", true},
|
||||||
{"5-alpine", "6-alpine", true},
|
{"5-alpine", "6-alpine", true},
|
||||||
{"5-alpine", "6.5-alpine", false},
|
{"5-alpine", "6.5-alpine", false},
|
||||||
|
{"5", "5-alpine", false},
|
||||||
}
|
}
|
||||||
for _, p := range pairs {
|
for _, p := range pairs {
|
||||||
p1, err := tagcmp.Parse(p.t1)
|
p1, err := tagcmp.Parse(p.t1)
|
||||||
|
|
Loading…
Reference in New Issue