version

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package version provides functions to get kernel version and compare it with a given one.

Index

Constants

This section is empty.

Variables

View Source
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

type KernelVersion struct {
	Kernel int
	Major  int
	Minor  int
	Flavor string
}

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

func GetLowerKernelVersionFromNodes(ctx context.Context, cl client.Client) (*KernelVersion, error)

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.

Jump to

Keyboard shortcuts

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