option to check prerelease tags

feature/poll-multi-tags
Karolis Rusenas 2018-10-14 22:18:24 +01:00
parent e8d2653ec9
commit 8276338271
1 changed files with 5 additions and 1 deletions

View File

@ -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)
}