Documentation ¶
Index ¶
- Constants
- Variables
- func AllWorkloadOSTypes(requestedSeries, imageStream string) (set.Strings, error)
- func AllWorkloadSeries(requestedSeries, imageStream string) (set.Strings, error)
- func CentOSVersionSeries(version string) (string, error)
- func ControllerSeries(now time.Time, requestedSeries, imageStream string) (set.Strings, error)
- func DefaultOSTypeNameFromSeries(series string) string
- func ESMSupportedJujuSeries() []string
- func GetOSFromSeries(series string) (coreos.OSType, error)
- func IsUnknownOSForSeriesError(err error) bool
- func IsWindowsNano(series string) bool
- func LatestLts() string
- func SeriesVersion(series string) (string, error)
- func SetLatestLtsForTesting(series string) string
- func SupportedJujuWorkloadSeries() []string
- func SupportedLts() []string
- func UbuntuSeriesVersion(series string) (string, error)
- func UpdateSeriesVersions() error
- func ValidateSeries(supportedSeries set.Strings, series, fallbackPreferredSeries string) (string, error)
- func VersionSeries(version string) (string, error)
- func WindowsVersionSeries(version string) (string, error)
- func WindowsVersions() map[string]string
- func WorkloadSeries(now time.Time, requestedSeries, imageStream string) (set.Strings, error)
- type DistroSource
- type SeriesName
- type SupportedSeriesFunc
- type WorkloadType
Constants ¶
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.
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 AllWorkloadSeries ¶
AllWorkloadSeries returns all the workload series (supported or not).
func CentOSVersionSeries ¶
CentOSVersionSeries validates that the supplied series (eg: centos7) is supported.
func ControllerSeries ¶
ControllerSeries returns all the controller series available to it at the execution time.
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 IsUnknownOSForSeriesError ¶
IsUnknownOSForSeriesError returns true if err is of type unknownOSForSeriesError.
func IsWindowsNano ¶
IsWindowsNano tells us whether the provided series is a nano series. It may seem futile at this point, but more nano series will come up with time. This is here and not in a windows specific package because we might want to take decisions dependant on whether we have a nano series or not in more general code.
func LatestLts ¶
func LatestLts() string
LatestLts returns the Latest LTS Release found in distro-info
func SeriesVersion ¶
SeriesVersion returns the version for the specified series.
func SetLatestLtsForTesting ¶
SetLatestLtsForTesting is provided to allow tests to override the lts series used and decouple the tests from the host by avoiding calling out to distro-info. It returns the previous setting so that it may be set back to the original value by the caller.
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 UbuntuSeriesVersion ¶
UbuntuSeriesVersion returns the ubuntu version for the specified series.
func UpdateSeriesVersions ¶
func UpdateSeriesVersions() error
UpdateSeriesVersions forces an update of the series versions by querying distro-info if possible.
func ValidateSeries ¶
func ValidateSeries(supportedSeries set.Strings, series, fallbackPreferredSeries string) (string, error)
ValidateSeries attempts to validate a series if one is found, otherwise it uses the fallback series and validates that one. Returns the series it validated against or an error if one is found. Note: the selected series will be returned if there is an error to help use that for a fallback during error scenarios.
func VersionSeries ¶
VersionSeries returns the series (e.g.trusty) for the specified version (e.g. 14.04).
func WindowsVersionSeries ¶
WindowsVersionSeries returns the series (eg: win2012r2) for the specified version (eg: Windows Server 2012 R2 Standard)
func WindowsVersions ¶
WindowsVersions returns all windows versions as a map If we have nan and windows version in common, nano takes precedence
Types ¶
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" )
const ( Centos7 SeriesName = "centos7" Centos8 SeriesName = "centos8" OpenSUSELeap SeriesName = "opensuseleap" 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 )