1
// Copyright 2016 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
4
package migrationmaster
7
"github.com/juju/juju/agent"
8
"github.com/juju/juju/api/base"
9
masterapi "github.com/juju/juju/api/migrationmaster"
10
"github.com/juju/juju/worker"
11
"github.com/juju/juju/worker/dependency"
12
"github.com/juju/juju/worker/util"
15
// ManifoldConfig defines the names of the manifolds on which a
16
// Manifold will depend.
17
type ManifoldConfig util.PostUpgradeManifoldConfig
19
// Manifold returns a dependency manifold that runs the migration
21
func Manifold(config ManifoldConfig) dependency.Manifold {
22
return util.PostUpgradeManifold(util.PostUpgradeManifoldConfig(config), newWorker)
25
// newWorker is a shim to allow New to work with PostUpgradeManifold.
26
func newWorker(_ agent.Agent, apiCaller base.APICaller) (worker.Worker, error) {
27
client := masterapi.NewClient(apiCaller)
28
return New(client), nil