Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelConfig ¶
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