version

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: Apache-2.0 Imports: 3 Imported by: 3,074

Documentation

Overview

Package version supplies the type for version information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareKubeAwareVersionStrings

func CompareKubeAwareVersionStrings(v1, v2 string) int

CompareKubeAwareVersionStrings compares two kube-like version strings. Kube-like version strings are starting with a v, followed by a major version, optional "alpha" or "beta" strings followed by a minor version (e.g. v1, v2beta1). Versions will be sorted based on GA/alpha/beta first and then major and minor versions. e.g. v2, v1, v1beta2, v1beta1, v1alpha1.

Types

type Info

type Info struct {
	// Major is the major version of the binary version
	Major string `json:"major"`
	// Minor is the minor version of the binary version
	Minor string `json:"minor"`
	// EmulationMajor is the major version of the emulation version
	EmulationMajor string `json:"emulationMajor,omitempty"`
	// EmulationMinor is the minor version of the emulation version
	EmulationMinor string `json:"emulationMinor,omitempty"`
	// MinCompatibilityMajor is the major version of the minimum compatibility version
	MinCompatibilityMajor string `json:"minCompatibilityMajor,omitempty"`
	// MinCompatibilityMinor is the minor version of the minimum compatibility version
	MinCompatibilityMinor string `json:"minCompatibilityMinor,omitempty"`
	GitVersion            string `json:"gitVersion"`
	GitCommit             string `json:"gitCommit"`
	GitTreeState          string `json:"gitTreeState"`
	BuildDate             string `json:"buildDate"`
	GoVersion             string `json:"goVersion"`
	Compiler              string `json:"compiler"`
	Platform              string `json:"platform"`
}

Info contains versioning information. TODO: Add []string of api versions supported? It's still unclear how we'll want to distribute that information.

func (Info) String

func (info Info) String() string

String returns info as a human-friendly version string.

Jump to

Keyboard shortcuts

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