7
"github.com/juju/utils/voyeur"
7
9
coreagent "github.com/juju/juju/agent"
8
10
"github.com/juju/juju/api"
9
11
apideployer "github.com/juju/juju/api/deployer"
10
12
"github.com/juju/juju/state"
11
"github.com/juju/juju/version"
12
13
"github.com/juju/juju/worker"
13
14
"github.com/juju/juju/worker/agent"
14
15
"github.com/juju/juju/worker/apiaddressupdater"
25
26
"github.com/juju/juju/worker/proxyupdater"
26
27
"github.com/juju/juju/worker/reboot"
27
28
"github.com/juju/juju/worker/resumer"
29
workerstate "github.com/juju/juju/worker/state"
30
"github.com/juju/juju/worker/stateconfigwatcher"
28
31
"github.com/juju/juju/worker/storageprovisioner"
29
32
"github.com/juju/juju/worker/terminationworker"
33
"github.com/juju/juju/worker/toolsversionchecker"
30
34
"github.com/juju/juju/worker/upgrader"
31
35
"github.com/juju/juju/worker/upgradesteps"
32
36
"github.com/juju/juju/worker/upgradewaiter"
33
37
"github.com/juju/juju/worker/util"
34
38
"github.com/juju/utils/clock"
39
"github.com/juju/version"
37
42
// ManifoldsConfig allows specialisation of the result of Manifolds.
40
45
// its dependencies via a dependency.Engine.
41
46
Agent coreagent.Agent
48
// AgentConfigChanged is set whenever the machine agent's config
50
AgentConfigChanged *voyeur.Value
43
52
// PreviousAgentVersion passes through the version the machine
44
53
// agent was running before the current restart.
45
54
PreviousAgentVersion version.Number
54
63
// upgrader worker completes it's first check.
55
64
UpgradeCheckLock gate.Lock
66
// OpenState is function used by the state manifold to create a
68
OpenState func(coreagent.Config) (*state.State, error)
57
70
// OpenStateForUpgrade is a function the upgradesteps worker can
58
71
// use to establish a connection to state.
59
OpenStateForUpgrade func() (*state.State, func(), error)
72
OpenStateForUpgrade func() (*state.State, error)
74
// StartStateWorkers is function called by the stateworkers
75
// manifold to start workers which rely on a *state.State but
76
// which haven't been converted to run directly under the
77
// dependency engine yet. This will go once these workers have
79
StartStateWorkers func(*state.State) (worker.Worker, error)
61
81
// WriteUninstallFile is a function the uninstaller manifold uses
62
82
// to write the agent uninstall file.
104
124
terminationName: terminationworker.Manifold(),
126
// The stateconfigwatcher manifold watches the machine agent's
127
// configuration and reports if state serving info is
128
// present. It will bounce itself if state serving info is
129
// added or removed. It is intended as a dependency just for
130
// the state manifold.
131
stateConfigWatcherName: stateconfigwatcher.Manifold(stateconfigwatcher.ManifoldConfig{
132
AgentName: agentName,
133
AgentConfigChanged: config.AgentConfigChanged,
136
// The state manifold creates a *state.State and makes it
137
// available to other manifolds. It pings the mongodb session
138
// regularly and will die if pings fail.
139
stateName: workerstate.Manifold(workerstate.ManifoldConfig{
140
AgentName: agentName,
141
StateConfigWatcherName: stateConfigWatcherName,
142
OpenState: config.OpenState,
145
// The stateworkers manifold starts workers which rely on a
146
// *state.State but which haven't been converted to run
147
// directly under the dependency engine yet. This manifold
148
// will be removed once all such workers have been converted.
149
stateWorkersName: StateWorkersManifold(StateWorkersConfig{
150
StateName: stateName,
151
StartStateWorkers: config.StartStateWorkers,
106
154
// The api caller is a thin concurrent wrapper around a connection
107
155
// to some API server. It's used by many other manifolds, which all
108
156
// select their own desired facades. It will be interesting to see
297
345
APICallerName: apiCallerName,
298
346
UpgradeWaiterName: upgradeWaiterName,
349
toolsversioncheckerName: toolsversionchecker.Manifold(toolsversionchecker.ManifoldConfig{
350
AgentName: agentName,
351
APICallerName: apiCallerName,
352
UpgradeWaiterName: upgradeWaiterName,
304
358
agentName = "agent"
305
359
terminationName = "termination"
360
stateConfigWatcherName = "state-config-watcher"
362
stateWorkersName = "stateworkers"
306
363
apiCallerName = "api-caller"
307
apiInfoGateName = "api-info-gate"
308
364
upgradeStepsGateName = "upgrade-steps-gate"
309
365
upgradeCheckGateName = "upgrade-check-gate"
310
366
upgraderName = "upgrader"