version

package
v1.99.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConstraintK8sGreaterEqual126 is a version constraint for versions >= 1.26.
	ConstraintK8sGreaterEqual126 *semver.Constraints
	// ConstraintK8sLess126 is a version constraint for versions < 1.26.
	ConstraintK8sLess126 *semver.Constraints
	// ConstraintK8sGreaterEqual127 is a version constraint for versions >= 1.27.
	ConstraintK8sGreaterEqual127 *semver.Constraints
	// ConstraintK8sLess127 is a version constraint for versions < 1.27.
	ConstraintK8sLess127 *semver.Constraints
	// ConstraintK8sGreaterEqual128 is a version constraint for versions >= 1.28.
	ConstraintK8sGreaterEqual128 *semver.Constraints
	// ConstraintK8sGreaterEqual129 is a version constraint for versions >= 1.29.
	ConstraintK8sGreaterEqual129 *semver.Constraints
	// ConstraintK8sLess130 is a version constraint for versions < 1.30.
	ConstraintK8sLess130 *semver.Constraints
	// ConstraintK8sGreaterEqual130 is a version constraint for versions >= 1.30.
	ConstraintK8sGreaterEqual130 *semver.Constraints
)

Functions

func CheckVersionMeetsConstraint

func CheckVersionMeetsConstraint(version, constraint string) (bool, error)

CheckVersionMeetsConstraint returns true if the <version> meets the <constraint>.

func CompareVersions

func CompareVersions(version1, operator, version2 string) (bool, error)

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 VersionRange added in v1.84.0

type VersionRange struct {
	AddedInVersion   string
	RemovedInVersion string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL