kubernetesversion

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package kubernetesversion contains important structs and method for kubernetes version.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidFormat is used for invalid format.
	ErrInvalidFormat = fmt.Errorf("invalid format")

	// ErrInvalidMajorVersion is used for invalid major version.
	ErrInvalidMajorVersion = fmt.Errorf("invalid major version")

	// ErrInvalidMinorVersion is used for invalid minor version.
	ErrInvalidMinorVersion = fmt.Errorf("invalid minor version")
)

Functions

This section is empty.

Types

type KubernetesVersion

type KubernetesVersion struct {
	Major int
	Minor int
}

KubernetesVersion contains major and minor version.

func New

func New(majorStr, minorStr string) (KubernetesVersion, error)

New returns a kubernetes version from specified major and minor version.

func NewFromString

func NewFromString(str string) (KubernetesVersion, error)

NewFromString returns a kubernetes version from a specified input.

func (KubernetesVersion) String

func (kv KubernetesVersion) String() string

func (KubernetesVersion) StringWithDot

func (kv KubernetesVersion) StringWithDot() string

StringWithDot returns the Kubernetes version in the format <major>.<minor>, e.g. 1.27.

func (KubernetesVersion) Validate

func (kv KubernetesVersion) Validate() error

Validate validates a kubernetes version.

Jump to

Keyboard shortcuts

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