package version
import "k8s.io/component-base/version"
Index ¶
- Constants
- func Get() apimachineryversion.Info
- func SetDynamicVersion(dynamicVersion string) error
- func ValidateDynamicVersion(dynamicVersion string) error
- func ValidateKubeEffectiveVersion(effectiveVersion EffectiveVersion) error
- type EffectiveVersion
- type MutableEffectiveVersion
Constants ¶
const ( // DefaultKubeBinaryVersion is the hard coded k8 binary version based on the latest K8s release. // It is supposed to be consistent with gitMajor and gitMinor, except for local tests, where gitMajor and gitMinor are "". // Should update for each minor release! DefaultKubeBinaryVersion = "1.32" )
Functions ¶
func Get ¶
func Get() apimachineryversion.Info
Get returns the overall codebase version. It's for detecting what code a binary was built from.
func SetDynamicVersion ¶
SetDynamicVersion overrides the version returned as the GitVersion from Get(). The specified version must be non-empty, a valid semantic version, and must match the major/minor/patch version of the default gitVersion.
func ValidateDynamicVersion ¶
ValidateDynamicVersion ensures the given version is non-empty, a valid semantic version, and matched the major/minor/patch version of the default gitVersion.
func ValidateKubeEffectiveVersion ¶
func ValidateKubeEffectiveVersion(effectiveVersion EffectiveVersion) error
ValidateKubeEffectiveVersion validates the EmulationVersion is equal to the binary version at 1.31 for kube components. emulationVersion is introduced in 1.31, so it is only allowed to be equal to the binary version at 1.31.
Types ¶
type EffectiveVersion ¶
type EffectiveVersion interface { BinaryVersion() *version.Version EmulationVersion() *version.Version MinCompatibilityVersion() *version.Version EqualTo(other EffectiveVersion) bool String() string Validate() []error }
type MutableEffectiveVersion ¶
type MutableEffectiveVersion interface { EffectiveVersion Set(binaryVersion, emulationVersion, minCompatibilityVersion *version.Version) SetEmulationVersion(emulationVersion *version.Version) SetMinCompatibilityVersion(minCompatibilityVersion *version.Version) }
func DefaultBuildEffectiveVersion ¶
func DefaultBuildEffectiveVersion() MutableEffectiveVersion
DefaultBuildEffectiveVersion returns the MutableEffectiveVersion based on the current build information.
func DefaultKubeEffectiveVersion ¶
func DefaultKubeEffectiveVersion() MutableEffectiveVersion
DefaultKubeEffectiveVersion returns the MutableEffectiveVersion based on the latest K8s release.
func NewEffectiveVersion ¶
func NewEffectiveVersion(binaryVer string) MutableEffectiveVersion
Source Files ¶
base.go dynamic.go version.go
Directories ¶
Path | Synopsis |
---|---|
version/verflag | Package verflag defines utility functions to handle command line flags related to version of Kubernetes. |
- Version
- v0.32.3
- Published
- Mar 12, 2025
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 1 minute ago –
Tools for package owners.