Multiple blueprint fixes: - Extend the blueprint service customizations to accept services to be masked. - The `storage-path` and `container-transport` fields were removed in imagees 41.0 in order to simplify the way local storage containers are handled.
32 lines
766 B
Go
32 lines
766 B
Go
package common
|
|
|
|
import (
|
|
"github.com/hashicorp/go-version"
|
|
)
|
|
|
|
// Returns true if the version represented by the first argument is
|
|
// semantically older than the second.
|
|
//
|
|
// Meant to be used for comparing distro versions for differences between minor
|
|
// releases.
|
|
//
|
|
// Provided version strings are of any characters which are not
|
|
// digits or periods, and then split on periods.
|
|
// Assumes any missing components are 0, so 8 < 8.1.
|
|
// Evaluates to false if a and b are equal.
|
|
func VersionLessThan(a, b string) bool {
|
|
aV, err := version.NewVersion(a)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
bV, err := version.NewVersion(b)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
return aV.LessThan(bV)
|
|
}
|
|
|
|
func VersionGreaterThanOrEqual(a, b string) bool {
|
|
return !VersionLessThan(a, b)
|
|
}
|