Documentation ¶
Overview ¶
Package version provides functions to get kernel version and compare it with a given one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // MinimumKernelVersion is the minimum kernel version required by Liqo. MinimumKernelVersion = KernelVersion{ Kernel: 5, Major: 10, Minor: 0, } )
Functions ¶
func CheckKernelVersion ¶
func CheckKernelVersion(minimum *KernelVersion) error
CheckKernelVersion checks if the current kernel version satisfies the minimum requirements.
func CheckKernelVersionFromNodes ¶
func CheckKernelVersionFromNodes(ctx context.Context, cl client.Client, minimum *KernelVersion) error
CheckKernelVersionFromNodes checks if the current kernel version satisfies the minimum requirements from a list of nodes.
func Compare ¶
func Compare(a, b *KernelVersion) int
Compare compares two kernel.VersionInfo structs. Returns -1 if a < b, 0 if a == b, 1 it a > b.
Types ¶
type KernelVersion ¶
KernelVersion holds information about the kernel.
func GetKernelVersion ¶
func GetKernelVersion() (*KernelVersion, error)
GetKernelVersion gets the current kernel version.
func GetKernelVersionFromNode ¶
func GetKernelVersionFromNode(node *corev1.Node) (*KernelVersion, error)
GetKernelVersionFromNode gets the current kernel version from a node.
func GetLowerKernelVersionFromNodes ¶
GetLowerKernelVersionFromNodes gets the lower kernel version from a list of nodes.
func ParseRelease ¶
func ParseRelease(release string) (*KernelVersion, error)
ParseRelease parses a string and creates a VersionInfo based on it.
func (*KernelVersion) CheckRequirements ¶
func (kv *KernelVersion) CheckRequirements(minimumkv *KernelVersion) bool
CheckRequirements checks if the kernel version is compatible with the requirements.
func (*KernelVersion) Set ¶
func (kv *KernelVersion) Set(s string) error
Set parses a string and sets the KernelVersion.
func (*KernelVersion) String ¶
func (kv *KernelVersion) String() string
String returns the string representation of the KernelVersion.
func (*KernelVersion) Type ¶
func (kv *KernelVersion) Type() string
Type returns the type of the KernelVersion.