Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a dependency manifold that runs an upgrade-series worker, using the resource names defined in the supplied config.
Types ¶
type AgentService ¶
AgentService is a service managed by the local init system, for running a unit agent.
type Config ¶
type Config struct { // FacadeFactory is used to acquire back-end state with // the input tag context. FacadeFactory func(names.Tag) Facade // Logger is the logger for this worker. Logger Logger // Tag is the current machine tag. Tag names.Tag // ServiceAccess provides access to the local init system. Service ServiceAccess // UpgraderFactory is a factory method that will return an upgrader capable // of handling service and agent binary manipulation for a // runtime-determined target OS series. UpgraderFactory func(string) (Upgrader, error) }
Config is the configuration needed to construct an UpgradeSeries worker.
type Facade ¶
type Facade interface { // Getters WatchUpgradeSeriesNotifications() (watcher.NotifyWatcher, error) MachineStatus() (model.UpgradeSeriesStatus, error) UnitsPrepared() ([]names.UnitTag, error) UnitsCompleted() ([]names.UnitTag, error) TargetSeries() (string, error) // Setters StartUnitCompletion(reason string) error SetMachineStatus(status model.UpgradeSeriesStatus, reason string) error FinishUpgradeSeries(string) error PinMachineApplications() (map[string]error, error) UnpinMachineApplications() (map[string]error, error) }
Facade exposes the API surface required by the upgrade-series worker.
type Logger ¶
type Logger interface { Debugf(message string, args ...interface{}) Infof(message string, args ...interface{}) Warningf(message string, args ...interface{}) Errorf(message string, args ...interface{}) }
Logger represents the methods required to emit log messages.
type ManifoldConfig ¶
type ManifoldConfig struct { AgentName string APICallerName string Logger Logger NewFacade func(base.APICaller, names.Tag) Facade NewWorker func(Config) (worker.Worker, error) }
ManifoldConfig holds the information necessary for the dependency engine to to run an upgrade-series worker.
func (ManifoldConfig) Validate ¶
func (config ManifoldConfig) Validate() error
Validate validates the manifold configuration.
type ServiceAccess ¶
type ServiceAccess interface { // ListServices returns a slice of service // names known by the local init system. ListServices() ([]string, error) // DiscoverService returns a service implementation // based on the input service name and config. DiscoverService(string) (AgentService, error) }
ServiceAccess describes methods for interacting with the local init system.
type Upgrader ¶
type Upgrader interface {
PerformUpgrade() error
}
Upgrader describes methods required to perform file-system manipulation in preparation for upgrading the host Ubuntu version.
func NewUpgrader ¶
func NewUpgrader(toSeries string, manager service.SystemdServiceManager, logger Logger) (Upgrader, error)
NewUpgrader uses the input function to determine the series that should be supported, and returns a reference to a new Upgrader that supports it.