common

package
v0.0.0-...-a589d90 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModelConfig

type ModelConfig interface {
	// DefaultSeries returns the configured default Ubuntu series
	// for the environment, and whether the default series was
	// explicitly configured on the environment.
	DefaultSeries() (string, bool)
}

type SeriesSelector

type SeriesSelector struct {
	// seriesFlag is the series passed to the --series flag on the command line.
	SeriesFlag string
	// charmURLSeries is the series specified as part of the charm URL, i.e.
	// cs:trusty/ubuntu.
	CharmURLSeries string
	// conf is the configuration for the model we're deploying to.
	Conf ModelConfig
	// supportedSeries is the list of series the charm supports.
	SupportedSeries []string
	// supportedJujuSeries is the list of series that juju supports.
	SupportedJujuSeries set.Strings
	// force indicates the user explicitly wants to deploy to a requested
	// series, regardless of whether the charm says it supports that series.
	Force bool
}

seriesSelector is a helper type that determines what series the charm should be deployed to.

TODO: This type should really have a Validate method, as the force flag is really only valid if the seriesFlag is specified. There is code and tests that allow the force flag when series isn't specified, but they should really be cleaned up. The `deploy` CLI command has tests to ensure that --force is only valid with --series.

func (SeriesSelector) CharmSeries

func (s SeriesSelector) CharmSeries() (selectedSeries string, err error)

charmSeries determines what series to use with a charm. Order of preference is: - user requested with --series or defined by bundle when deploying - user requested in charm's url (e.g. juju deploy precise/ubuntu) - model default (if it matches supported series) - default from charm metadata supported series / series in url - default LTS

Jump to

Keyboard shortcuts

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