Documentation
¶
Overview ¶
Package version implements version handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// KubeSemver is the regex for Kubernetes versions. It requires the "v" prefix.
KubeSemver = regexp.MustCompile(`^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)([-0-9a-zA-Z_\.+]*)?$`)
// KubeSemverTolerant is the regex for Kubernetes versions with an optional "v" prefix.
KubeSemverTolerant = regexp.MustCompile(`^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)([-0-9a-zA-Z_\.+]*)?$`)
)
Functions ¶
func ParseMajorMinorPatch ¶
func ParseMajorMinorPatch(version string) (semver.Version, error)
ParseMajorMinorPatch returns a semver.Version from the string provided by looking only at major.minor.patch and stripping everything else out. It requires the version to have a "v" prefix.
func ParseMajorMinorPatchTolerant ¶
func ParseMajorMinorPatchTolerant(version string) (semver.Version, error)
ParseMajorMinorPatchTolerant returns a semver.Version from the string provided by looking only at major.minor.patch and stripping everything else out. It does not require the version to have a "v" prefix.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.