Documentation ¶
Index ¶
- Constants
- Variables
- func GetSeriesFromBase(v Base) (string, error)
- type Base
- func ControllerBases() []Base
- func MakeDefaultBase(os string, channel string) Base
- func MustParseBaseFromString(b string) Base
- func ParseBase(os string, channel string) (Base, error)
- func ParseBaseFromString(b string) (Base, error)
- func ParseManifestBases(manifestBases []charm.Base) ([]Base, error)
- func ValidateBase(supportedBases []Base, base, fallbackPreferredBase Base) (Base, error)
- func WorkloadBases() []Base
- type Channel
- type Risk
Constants ¶
const ( // UbuntuOS is the special value to be places in OS field of a base to // indicate an operating system is an Ubuntu distro UbuntuOS = "ubuntu" )
Variables ¶
Risks is a list of the available channel risks.
Functions ¶
func GetSeriesFromBase ¶
GetSeriesFromBase returns the series name for a given Base. This is needed to support legacy series.
Types ¶
type Base ¶
type Base struct { OS string // Channel is track[/risk/branch]. // eg "22.04" or "22.04/stable" etc. Channel Channel }
Base represents an OS/Channel. Bases can also be converted to and from a series string.
func ControllerBases ¶
func ControllerBases() []Base
ControllerBases returns the supported workload bases available to it at the execution time.
func MakeDefaultBase ¶
MakeDefaultBase creates a base from an os and simple version string, eg "22.04".
func MustParseBaseFromString ¶
MustParseBaseFromString is like ParseBaseFromString but panics if the string is invalid.
func ParseBaseFromString ¶
ParseBaseFromString takes a string containing os and channel separated by @ and returns a base.
func ParseManifestBases ¶
ParseManifestBases transforms charm.Bases to Bases. This format comes out of a charm.Manifest and contains architectures which Base does not. Only unique non architecture Bases will be returned.
func ValidateBase ¶
ValidateBase attempts to validate a base if one is found, otherwise it uses the fallback base and validates that one. Returns the base it validated against or an error if one is found. Note: the selected base will be returned if there is an error to help use that for a fallback during error scenarios.
func WorkloadBases ¶
func WorkloadBases() []Base
WorkloadBases returns the supported workload bases available to it at the execution time.
func (Base) DisplayString ¶
DisplayString returns the base string ignoring risk.
func (Base) IsCompatible ¶
IsCompatible returns true if base other is the same underlying OS version, ignoring risk.
func (Base) IsUbuntuLTS ¶
IsUbuntuLTS returns true if this base is a recognised Ubuntu LTS.
type Channel ¶
Channel identifies and describes completely an os channel.
A channel consists of, and is subdivided by, tracks and risk-levels:
- Tracks represents the version of the os, eg "22.04".
- Risk-levels represent a progressive potential trade-off between stability and new features.
The complete channel name can be structured as three distinct parts separated by slashes:
<track>/<risk>
func MakeDefaultChannel ¶
MakeDefaultChannel creates a normalized channel for the specified track with a default risk of "stable".
func ParseChannel ¶
ParseChannel parses a string representing a channel.
func ParseChannelNormalize ¶
ParseChannelNormalize parses a string representing a store channel. The returned channel's track, risk and name are normalized.