Documentation
¶
Index ¶
- Constants
- Variables
- func AllWorkloadOSTypes() (set.Strings, error)
- func AllWorkloadVersions() (set.Strings, error)
- func DefaultOSTypeNameFromSeries(series string) string
- func ESMSupportedJujuSeries() []string
- func GetOSFromSeries(series string) (ostype.OSType, error)
- func GetSeriesFromBase(v Base) (string, error)
- func GetSeriesFromChannel(name string, channel string) (string, error)
- func IsUnknownOSForSeriesError(err error) bool
- func SeriesVersion(series string) (string, error)
- func SupportedJujuWorkloadSeries() []string
- func SupportedLts() []string
- func UbuntuVersions(supported, esmSupported *bool) map[string]string
- func UpdateSeriesVersions() error
- type Base
- func ControllerBases(now time.Time, requestedBase Base, imageStream string) ([]Base, error)
- func GetBaseFromSeries(series string) (Base, error)
- func LegacyKubernetesBase() 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(now time.Time, requestedBase Base, imageStream string) ([]Base, error)
- type Channel
- type DistroSource
- type Risk
- type SeriesName
- type SupportedSeriesFunc
- type WorkloadType
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" // CentosOS is the special value to be places in OS field of a base to // indicate an operating system is a CentOS distro CentosOS = "centos" )
const ( // Daily defines if a image-stream is set to this, then you get a different // set of logic. In this case if you want to test drive new releases, it's // required that the image-stream modelconfig is set from released to // daily. Daily = "daily" )
Variables ¶
var LocalSeriesVersionInfo = series.LocalSeriesVersionInfo
LocalSeriesVersionInfo is patched for tests.
Risks is a list of the available channel risks.
var UbuntuDistroInfo = series.UbuntuDistroInfo
UbuntuDistroInfo is the path for the Ubuntu distro info file.
Functions ¶
func AllWorkloadOSTypes ¶
AllWorkloadOSTypes returns all the workload os types (supported or not).
func AllWorkloadVersions ¶
AllWorkloadVersions returns all the workload versions (supported or not).
func DefaultOSTypeNameFromSeries ¶
DefaultOSTypeNameFromSeries returns the operating system based on the given series, defaulting to Ubuntu for unknown series.
func ESMSupportedJujuSeries ¶
func ESMSupportedJujuSeries() []string
ESMSupportedJujuSeries returns a slice of just juju extended security maintenance supported ubuntu series.
func GetOSFromSeries ¶
GetOSFromSeries will return the operating system based on the series that is passed to it
func GetSeriesFromBase ¶
GetSeriesFromBase returns the series name for a given Base. This is needed to support legacy series.
func GetSeriesFromChannel ¶
GetSeriesFromChannel gets the series from os name and channel.
func IsUnknownOSForSeriesError ¶
IsUnknownOSForSeriesError returns true if err is of type unknownOSForSeriesError.
func SeriesVersion ¶
SeriesVersion returns the version for the specified series.
func SupportedJujuWorkloadSeries ¶
func SupportedJujuWorkloadSeries() []string
SupportedJujuWorkloadSeries returns a slice of juju supported series that target a workload (deploying a charm).
func SupportedLts ¶
func SupportedLts() []string
SupportedLts are the current supported LTS series in ascending order.
func UbuntuVersions ¶
UbuntuVersions returns the ubuntu versions as a map.
func UpdateSeriesVersions ¶
func UpdateSeriesVersions() error
UpdateSeriesVersions forces an update of the series versions by querying distro-info if possible.
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 ¶
ControllerBases returns the supported workload bases available to it at the execution time.
func GetBaseFromSeries ¶
GetBaseFromSeries returns the Base infor for a series.
func LegacyKubernetesBase ¶
func LegacyKubernetesBase() Base
LegacyKubernetesBase is the ubuntu base image for legacy k8s charms.
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 ¶
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.
func (Channel) DisplayString ¶
type DistroSource ¶
type DistroSource interface { // Refresh will attempt to update the information it has about each distro // and if the distro is supported or not. Refresh() error // SeriesInfo returns the DistroInfoSerie for the series name. SeriesInfo(seriesName string) (series.DistroInfoSerie, bool) }
DistroSource is the source of the underlying distro source for supported series.
type SeriesName ¶
type SeriesName string
SeriesName represents a series name for distros
const ( Precise SeriesName = "precise" Quantal SeriesName = "quantal" Raring SeriesName = "raring" Saucy SeriesName = "saucy" Trusty SeriesName = "trusty" Utopic SeriesName = "utopic" Vivid SeriesName = "vivid" Wily SeriesName = "wily" Xenial SeriesName = "xenial" Yakkety SeriesName = "yakkety" Zesty SeriesName = "zesty" Artful SeriesName = "artful" Bionic SeriesName = "bionic" Cosmic SeriesName = "cosmic" Disco SeriesName = "disco" Eoan SeriesName = "eoan" Focal SeriesName = "focal" Groovy SeriesName = "groovy" Hirsute SeriesName = "hirsute" Impish SeriesName = "impish" Jammy SeriesName = "jammy" Kinetic SeriesName = "kinetic" Lunar SeriesName = "lunar" Mantic SeriesName = "mantic" Noble SeriesName = "noble" )
const ( Centos7 SeriesName = "centos7" Centos9 SeriesName = "centos9" Kubernetes SeriesName = "kubernetes" )
func (SeriesName) String ¶
func (s SeriesName) String() string
type SupportedSeriesFunc ¶
SupportedSeriesFunc describes a function that has commonality between controller and workload types.
type WorkloadType ¶
type WorkloadType int
WorkloadType defines what type of workload the series is aimed at. Controllers only support Ubuntu systems.
const ( // ControllerWorkloadType defines a workload type that is for controllers // only. ControllerWorkloadType WorkloadType = iota // OtherWorkloadType workload type is for everything else. // In the future we might want to differentiate this. OtherWorkloadType // UnsupportedWorkloadType is used where the series does not support // running Juju agents. UnsupportedWorkloadType )