-
Notifications
You must be signed in to change notification settings - Fork 0
/
steps_263.go
45 lines (39 loc) · 1.13 KB
/
steps_263.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2019 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package upgrades
import (
"gopkg.in/juju/names.v3"
"github.com/juju/juju/api/upgradesteps"
)
// stepsFor263 returns upgrade steps for Juju 2.6.3.
func stepsFor263() []Step {
return []Step{
&upgradeStep{
description: "reset kvm machine modification status to idle",
targets: []Target{AllMachines},
run: resetKVMMachineModificationStatusIdle,
},
}
}
func resetKVMMachineModificationStatusIdle(context Context) error {
tag := context.AgentConfig().Tag()
if !names.IsContainerMachine(tag.Id()) {
// Skip if not a container, work to be done only on KVM
// machines.
return nil
}
client := upgradesteps.NewClient(context.APIState())
return client.ResetKVMMachineModificationStatusIdle(tag)
}
// stateStepsFor263 returns upgrade steps for Juju 2.6.3.
func stateStepsFor263() []Step {
return []Step{
&upgradeStep{
description: "update model name index of k8s models",
targets: []Target{DatabaseMaster},
run: func(context Context) error {
return context.State().UpdateK8sModelNameIndex()
},
},
}
}