kubeapi

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MalformedVersionError = func(version string) error {
		return eris.Errorf("Failed to parse kubernetes api version from %v", version)
	}

	InvalidMajorVersionError = eris.New("Major version cannot be zero")

	InvalidPrereleaseVersionError = eris.New("Prerelease version cannot be zero")
)

Functions

This section is empty.

Types

type PrereleaseModifier

type PrereleaseModifier int
const (
	Alpha PrereleaseModifier = iota + 1
	Beta
	GA
)

func (PrereleaseModifier) String

func (m PrereleaseModifier) String() string

type Version

type Version interface {
	Major() int
	Prerelease() int
	PrereleaseModifier() PrereleaseModifier
	String() string
	GreaterThan(other Version) bool
	LessThan(other Version) bool
	Equal(other Version) bool
}

Version models the structure of Kubernetes API version tags, but does NOT handle version as documented by k8s. Priority is assigned by implied order of release, such that alpha/beta v2 tags are "greater than" the GA v1 tag. https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning/#version-priority

func ParseVersion

func ParseVersion(v string) (Version, error)

type VersionList

type VersionList []Version

VersionList implements sort.Interface for a list of Kubernetes API version tags.

func (VersionList) Len

func (list VersionList) Len() int

func (VersionList) Less

func (list VersionList) Less(i, j int) bool

func (VersionList) Swap

func (list VersionList) Swap(i, j int)

Jump to

Keyboard shortcuts

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