clusterstack

package
v0.1.0-alpha.5 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: 4 Imported by: 1

Documentation

Overview

Package clusterstack contains functions related to clusterstacks.

Index

Constants

View Source
const (
	// ClusterStacksDownloadDirectory is the cluster stack download directory.
	ClusterStacksDownloadDirectory = "cluster-stacks"

	// NodeImageDownloadDirectory is the node image untar directory.
	NodeImageDownloadDirectory = "node-images"
)
View Source
const (
	// Separator defines the separator for cluster stack strings.
	Separator = "-"
)

Variables

View Source
var (
	// ErrInvalidFormat indicates a cluster stack string has an invalid format.
	ErrInvalidFormat = fmt.Errorf("invalid format")
	// ErrInvalidProvider indicates a cluster stack string has an invalid provider.
	ErrInvalidProvider = fmt.Errorf("invalid provider")
	// ErrInvalidName indicates a cluster stack string has an invalid name.
	ErrInvalidName = fmt.Errorf("invalid name")
)

Functions

This section is empty.

Types

type ClusterStack

type ClusterStack struct {
	Provider          string
	Name              string
	KubernetesVersion kubernetesversion.KubernetesVersion
	Version           version.Version
}

ClusterStack contains all properties defining a cluster stack.

func New

func New(provider, name, kubernetesVersion, csVersion string) (ClusterStack, error)

New returns a ClusterStack based on a cluster stack properties and the version is in the form of - "v1", "v1-alpha.1", etc.

func NewFromClusterClassProperties

func NewFromClusterClassProperties(str string) (ClusterStack, error)

NewFromClusterClassProperties returns a ClusterStack based on a cluster stack string. e.g. - "docker-ferrol-1-27-v1", "docker-ferrol-1-27-v1-alpha.1", etc.

func NewFromClusterStackReleaseProperties

func NewFromClusterStackReleaseProperties(str string) (ClusterStack, error)

NewFromClusterStackReleaseProperties returns a ClusterStack based on a cluster stack string. e.g. - "docker-ferrol-1-27-v1", "docker-ferrol-1-27-v1-alpha-1", etc.

func (*ClusterStack) String

func (cs *ClusterStack) String() string

func (*ClusterStack) Validate

func (cs *ClusterStack) Validate() error

Validate validates a given ClusterStack.

type ClusterStacks

type ClusterStacks []ClusterStack

ClusterStacks implements sort.Interface for []ClusterStack based on the release name / tag.

func (ClusterStacks) Contains

func (r ClusterStacks) Contains(name string) bool

Contains return if releases slice contains the given name or not.

func (ClusterStacks) Latest

func (r ClusterStacks) Latest() *ClusterStack

Latest returns the latest release from the slice. If the slice is empty, it returns nil. The slice is expected to be sorted.

func (ClusterStacks) Len

func (r ClusterStacks) Len() int

Len returns the length of the slice.

func (ClusterStacks) Less

func (r ClusterStacks) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (ClusterStacks) Swap

func (r ClusterStacks) Swap(i, j int)

Swap swaps the elements with indexes i and j.

Jump to

Keyboard shortcuts

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