diff --git a/util/version/version.go b/util/version/version.go index 098873eb..2d13646b 100644 --- a/util/version/version.go +++ b/util/version/version.go @@ -75,7 +75,7 @@ func GetImageNameAndVersion(name string) (string, *types.Version, error) { // NewAvailable - takes version and current tags. Checks whether there is a new version in the list of tags // and returns it as well as newAvailable bool -func NewAvailable(current string, tags []string) (newVersion string, newAvailable bool, err error) { +func NewAvailable(current string, tags []string, matchPreRelease bool) (newVersion string, newAvailable bool, err error) { currentVersion, err := semver.NewVersion(current) if err != nil { @@ -98,6 +98,10 @@ func NewAvailable(current string, tags []string) (newVersion string, newAvailabl } + if matchPreRelease && currentVersion.Prerelease() != v.Prerelease() { + continue + } + vs = append(vs, v) }