Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfMinorVersionUpdate ¶ added in v1.125.1
CheckIfMinorVersionUpdate checks if the new version is a minor version update to the old version.
func CheckVersionMeetsConstraint ¶
CheckVersionMeetsConstraint returns true if the <version> meets the <constraint>.
func CompareVersions ¶
CompareVersions returns true if the constraint <version1> compared by <operator> to <version2> returns true, and false otherwise. The comparison is based on semantic versions, i.e. <version1> and <version2> will be converted if needed.
Types ¶
type Constraints ¶
type Constraints struct {
*semver.Constraints
}
Constraints is a wrapper around semver.Constraints.
var ( // ConstraintK8sLess131 is a version constraint for versions < 1.31. ConstraintK8sLess131 *Constraints // ConstraintK8sEqual131 is a version constraint for versions == 1.31. ConstraintK8sEqual131 *Constraints // ConstraintK8sGreaterEqual131 is a version constraint for versions >= 1.31. ConstraintK8sGreaterEqual131 *Constraints // ConstraintK8sLess132 is a version constraint for versions < 1.32. ConstraintK8sLess132 *Constraints // ConstraintK8sGreaterEqual132 is a version constraint for versions >= 1.32. ConstraintK8sGreaterEqual132 *Constraints // ConstraintK8sLess133 is a version constraint for versions < 1.33. ConstraintK8sLess133 *Constraints // ConstraintK8sGreaterEqual133 is a version constraint for versions >= 1.33. ConstraintK8sGreaterEqual133 *Constraints // ConstraintK8sLess134 is a version constraint for versions < 1.34. ConstraintK8sLess134 *Constraints // ConstraintK8sGreaterEqual134 is a version constraint for versions >= 1.34. ConstraintK8sGreaterEqual134 *Constraints // ConstraintK8sLess135 is a version constraint for versions < 1.35. ConstraintK8sLess135 *Constraints // ConstraintK8sGreaterEqual135 is a version constraint for versions >= 1.35. ConstraintK8sGreaterEqual135 *Constraints )
func MustNewConstraint ¶
func MustNewConstraint(constraintStr string) *Constraints
MustNewConstraint creates a new Constraints object from the given constraint string. The function panics if the passed constraint is invalid.
func (*Constraints) CheckVersion ¶
func (c *Constraints) CheckVersion(version string) bool
CheckVersion checks whether the given version string satisfies the constraints. Please ensure the passed version is a valid semantic version (errors related to parsing the version will result in `false` being returned - the error is omitted).
type VersionRange ¶ added in v1.84.0
VersionRange represents a version range of type [AddedInVersion, RemovedInVersion).
func (*VersionRange) Contains ¶ added in v1.84.0
func (r *VersionRange) Contains(version string) (bool, error)
Contains returns true if the range contains the given version, false otherwise. The range contains the given version only if it's greater or equal than AddedInVersion (always true if AddedInVersion is empty), and less than RemovedInVersion (always true if RemovedInVersion is empty).
func (*VersionRange) SupportedVersionRange ¶ added in v1.84.0
func (r *VersionRange) SupportedVersionRange() string
SupportedVersionRange returns the supported version range for the given API.