k3s

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Name   string `json:"name"`   // id and name normally the same
	Latest string `json:"latest"` // ie v1.18.10+k3s1

}

Channel has info about a specific k3s release channel

type Manager

type Manager struct {
	Releases ReleaseInfo
}

Manager will handle installation of k3s

func NewManager

func NewManager() *Manager

NewManager will create a new k3s manager

func (*Manager) CheckRequirements

func (m *Manager) CheckRequirements() (bool, error)

CheckRequirements will make sure required components are installed

func (*Manager) Install

func (m *Manager) Install(ipAddress string, k3sVersion string, appName string) bool

Install k3s on given VM

type Release

type Release struct {
	FullName   string // v1.19-rc1+k3s1
	Name       string // v1.19-rc1
	Channel    string // 1.19
	Major      string // 1
	Minor      string // 19
	Patch      string // 2
	Extra      string // rc1
	K3sRelease string // k3s1
}

Release of k3s

func (*Release) Parse

func (r *Release) Parse(releaseStr string) (err error)

Parse will take a given version string into parse into its components

type ReleaseInfo

type ReleaseInfo struct {
	Channels []Channel           `json:"data"`
	Releases map[string][]string // list of available k3s versions, groups by track (ie 1.19)
}

ReleaseInfo is a list of k3s release channels

func (*ReleaseInfo) GetChannel

func (ri *ReleaseInfo) GetChannel(desiredChannel string) (channel Channel, err error)

GetChannel info on desired release channel

func (*ReleaseInfo) GetChannels

func (ri *ReleaseInfo) GetChannels() (channels []string, err error)

GetChannels returns array of all valid channel names

func (*ReleaseInfo) GetLatestRelease

func (ri *ReleaseInfo) GetLatestRelease(desiredChannel string) (latestRelease string, err error)

GetLatestRelease of k3s that is available for a given channel

func (*ReleaseInfo) GetReleases

func (ri *ReleaseInfo) GetReleases(desiredChannel string) (releases []string, err error)

GetReleases will return all the releases for a given channel

func (*ReleaseInfo) LoadChannels

func (ri *ReleaseInfo) LoadChannels() error

LoadChannels will get the channel details from updates.k3s.io

func (*ReleaseInfo) LoadReleases

func (ri *ReleaseInfo) LoadReleases() error

LoadReleases will get a list of all

func (*ReleaseInfo) ReleaseExists

func (ri *ReleaseInfo) ReleaseExists(desiredRelease string) bool

ReleaseExists will see if given release exists and if so, returns details

func (*ReleaseInfo) Translate

func (ri *ReleaseInfo) Translate(desiredRelease string) (release string, err error)

Translate will take a channel name or a specific release 'stable', 'latest', 'v1.18', 'v1.18.2', 'v1.18.2+k3s1'

Jump to

Keyboard shortcuts

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