caasupgrader

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: 19 Imported by: 0

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 upgrader worker, using the resource names defined in the supplied config.

Types

type CAASOperatorUpgrader

type CAASOperatorUpgrader interface {
	Upgrade(agentTag string, v version.Number) error
}

type Config

type Config struct {
	UpgraderClient              UpgraderClient
	CAASOperatorUpgrader        CAASOperatorUpgrader
	AgentTag                    names.Tag
	OrigAgentVersion            version.Number
	UpgradeStepsWaiter          gate.Waiter
	InitialUpgradeCheckComplete gate.Unlocker
}

Config contains the items the worker needs to start.

type ManifoldConfig

type ManifoldConfig struct {
	AgentName            string
	APICallerName        string
	UpgradeStepsGateName string
	UpgradeCheckGateName string
	PreviousAgentVersion version.Number
}

ManifoldConfig defines the names of the manifolds on which a Manifold will depend.

type Upgrader

type Upgrader struct {
	// contains filtered or unexported fields
}

Upgrader represents a worker that watches the state for upgrade requests for a given CAAS agent.

func NewUpgrader

func NewUpgrader(config Config) (*Upgrader, error)

NewUpgrader returns a new upgrader worker. It watches changes to the current version of a CAAS agent. If an upgrade is needed, the worker updates the docker image version for the specified agent. TODO(caas) - support HA controllers

func (*Upgrader) Kill

func (u *Upgrader) Kill()

Kill implements worker.Worker.Kill.

func (*Upgrader) Wait

func (u *Upgrader) Wait() error

Wait implements worker.Worker.Wait.

type UpgraderClient

type UpgraderClient interface {
	DesiredVersion(tag string) (version.Number, error)
	SetVersion(tag string, v version.Binary) error
	WatchAPIVersion(agentTag string) (watcher.NotifyWatcher, error)
}

UpgraderClient provides the facade methods used by the worker.

Jump to

Keyboard shortcuts

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