series

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var LocalSeriesVersionInfo = series.LocalSeriesVersionInfo

LocalSeriesVersionInfo is patched for tests.

View Source
var UbuntuDistroInfo = series.UbuntuDistroInfo

UbuntuDistroInfo is the path for the Ubuntu distro info file.

Functions

func AllWorkloadOSTypes

func AllWorkloadOSTypes(requestedSeries, imageStream string) (set.Strings, error)

AllWorkloadOSTypes returns all the workload os types (supported or not).

func AllWorkloadSeries

func AllWorkloadSeries(requestedSeries, imageStream string) (set.Strings, error)

AllWorkloadSeries returns all the workload series (supported or not).

func CentOSVersionSeries

func CentOSVersionSeries(version string) (string, error)

CentOSVersionSeries validates that the supplied series (eg: centos7) is supported.

func ControllerSeries

func ControllerSeries(now time.Time, requestedSeries, imageStream string) (set.Strings, error)

ControllerSeries returns all the controller series available to it at the execution time.

func DefaultOSTypeNameFromSeries

func DefaultOSTypeNameFromSeries(series string) string

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

func GetOSFromSeries(series string) (coreos.OSType, error)

GetOSFromSeries will return the operating system based on the series that is passed to it

func IsUnknownOSForSeriesError

func IsUnknownOSForSeriesError(err error) bool

IsUnknownOSForSeriesError returns true if err is of type unknownOSForSeriesError.

func IsWindowsNano

func IsWindowsNano(series string) bool

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

func SeriesVersion(series string) (string, error)

SeriesVersion returns the version for the specified series.

func SetLatestLtsForTesting

func SetLatestLtsForTesting(series string) string

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

func UbuntuSeriesVersion(series string) (string, error)

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

func VersionSeries(version string) (string, error)

VersionSeries returns the series (e.g.trusty) for the specified version (e.g. 14.04).

func WindowsVersionSeries

func WindowsVersionSeries(version string) (string, error)

WindowsVersionSeries returns the series (eg: win2012r2) for the specified version (eg: Windows Server 2012 R2 Standard)

func WindowsVersions

func WindowsVersions() map[string]string

WindowsVersions returns all windows versions as a map If we have nan and windows version in common, nano takes precedence

func WorkloadSeries

func WorkloadSeries(now time.Time, requestedSeries, imageStream string) (set.Strings, error)

WorkloadSeries returns the supported workload series available to it at the execution time.

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"
)
const (
	Centos7      SeriesName = "centos7"
	Centos8      SeriesName = "centos8"
	OpenSUSELeap SeriesName = "opensuseleap"
	GenericLinux SeriesName = "genericlinux"
	Kubernetes   SeriesName = "kubernetes"
)

func (SeriesName) String

func (s SeriesName) String() string

type SupportedSeriesFunc

type SupportedSeriesFunc = func(time.Time, string, string) (set.Strings, error)

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
)

Jump to

Keyboard shortcuts

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