Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PerformUpgrade = upgrades.PerformUpgrade // Allow patching

	// The maximum time a master controller will wait for other
	// controllers to come up and indicate they are ready to begin
	// running upgrade steps.
	UpgradeStartTimeoutMaster = time.Minute * 15

	// The maximum time a secondary controller will wait for other
	// controllers to come up and indicate they are ready to begin
	// running upgrade steps. This is effectively "forever" because we
	// don't really want secondaries to ever give up once they've
	// indicated that they're ready to upgrade. It's up to the master
	// to abort the upgrade if required.
	//
	// This should get reduced when/if master re-elections are
	// introduce in the case a master that failing to come up for
	// upgrade.
	UpgradeStartTimeoutSecondary = time.Hour * 4
)
View Source
var IsMachineMaster = func(st *state.State, machineId string) (bool, error) {
	if st == nil {

		return false, nil
	}

	machine, err := st.Machine(machineId)
	if err != nil {

		return false, errors.Trace(err)
	}
	isMaster, err := mongo.IsMaster(st.MongoSession(), machine)
	if err != nil {
		return false, errors.Trace(err)
	}
	return isMaster, nil
}

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.

    func NewLock

    func NewLock(a agent.Agent) (gate.Lock, error)

      NewLock creates a gate.Lock to be used to synchronise workers which need to start after upgrades have completed. If no upgrade steps are required the Lock is unlocked and the version in agent's configuration is updated to the currently running version.

      The returned Lock should be passed to NewWorker.

      func NewWorker

      func NewWorker(
      	upgradeComplete gate.Lock,
      	agent agent.Agent,
      	apiConn api.Connection,
      	jobs []multiwatcher.MachineJob,
      	openState func() (*state.State, error),
      	preUpgradeSteps func(st *state.State, agentConf agent.Config, isController, isMasterServer bool) error,
      	machine StatusSetter,
      ) (worker.Worker, error)

        NewWorker returns a new instance of the upgradesteps worker. It will run any required steps to upgrade to the currently running Juju version.

        Types

        type ManifoldConfig

        type ManifoldConfig struct {
        	AgentName            string
        	APICallerName        string
        	UpgradeStepsGateName string
        	OpenStateForUpgrade  func() (*state.State, error)
        	PreUpgradeSteps      func(*state.State, agent.Config, bool, bool) error
        }

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

          type StatusSetter

          type StatusSetter interface {
          	SetStatus(setableStatus status.Status, info string, data map[string]interface{}) error
          }

            StatusSetter defines the single method required to set an agent's status.