Skip to content

Commit 3abfef4

Browse files
zaksoupdpb587-pivotal
authored andcommitted
Change vm-resurrection -> update-resurrection
Signed-off-by: Danny Berger <dberger@pivotal.io>
1 parent de8a341 commit 3abfef4

File tree

7 files changed

+58
-58
lines changed

7 files changed

+58
-58
lines changed

cmd/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ func (c Cmd) Execute() (cmdErr error) {
214214
case *InstancesOpts:
215215
return NewInstancesCmd(deps.UI, c.deployment()).Run(*opts)
216216

217-
case *VMResurrectionOpts:
218-
return NewVMResurrectionCmd(c.director()).Run(*opts)
217+
case *UpdateResurrectionOpts:
218+
return NewUpdateResurrectionCmd(c.director()).Run(*opts)
219219

220220
case *DeployOpts:
221221
director, deployment := c.directorAndDeployment()

cmd/factory_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,24 @@ var _ = Describe("Factory", func() {
7878
"delete-snapshots": []string{},
7979
"instances": []string{},
8080
"vms": []string{},
81-
"vm-resurrection": []string{"off"},
82-
"cloud-check": []string{},
83-
"logs": []string{"slug"},
84-
"start": []string{"slug"},
85-
"stop": []string{"slug"},
86-
"restart": []string{"slug"},
87-
"recreate": []string{"slug"},
88-
"init-release": []string{},
89-
"reset-release": []string{},
90-
"generate-job": []string{"/file"},
91-
"generate-package": []string{"/file"},
92-
"create-release": []string{"/file"},
93-
"finalize-release": []string{"/file"},
94-
"blobs": []string{},
95-
"add-blob": []string{"/file", "directory"},
96-
"remove-blob": []string{"/file"},
97-
"sync-blobs": []string{},
98-
"upload-blobs": []string{},
81+
"update-resurrection": []string{"off"},
82+
"cloud-check": []string{},
83+
"logs": []string{"slug"},
84+
"start": []string{"slug"},
85+
"stop": []string{"slug"},
86+
"restart": []string{"slug"},
87+
"recreate": []string{"slug"},
88+
"init-release": []string{},
89+
"reset-release": []string{},
90+
"generate-job": []string{"/file"},
91+
"generate-package": []string{"/file"},
92+
"create-release": []string{"/file"},
93+
"finalize-release": []string{"/file"},
94+
"blobs": []string{},
95+
"add-blob": []string{"/file", "directory"},
96+
"remove-blob": []string{"/file"},
97+
"sync-blobs": []string{},
98+
"upload-blobs": []string{},
9999
}
100100

101101
for cmd, requiredArgs := range cmds {

cmd/opts.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ type BoshOpts struct {
101101
DeleteSnapshots DeleteSnapshotsOpts `command:"delete-snapshots" alias:"delsnaps" description:"Delete all snapshots in a deployment"`
102102

103103
// Instances
104-
Instances InstancesOpts `command:"instances" alias:"is" alias:"ins" description:"List all instances in a deployment"`
105-
VMs VMsOpts `command:"vms" description:"List all VMs in all deployments"`
106-
VMResurrection VMResurrectionOpts `command:"vm-resurrection" alias:"vmr" description:"Enable/disable resurrection for a given VM"`
107-
CloudCheck CloudCheckOpts `command:"cloud-check" alias:"cck" alias:"cloudcheck" description:"Cloud consistency check and interactive repair"`
104+
Instances InstancesOpts `command:"instances" alias:"is" alias:"ins" description:"List all instances in a deployment"`
105+
VMs VMsOpts `command:"vms" description:"List all VMs in all deployments"`
106+
UpdateResurrection UpdateResurrectionOpts `command:"update-resurrection" description:"Enable/disable resurrection"`
107+
CloudCheck CloudCheckOpts `command:"cloud-check" alias:"cck" alias:"cloudcheck" description:"Cloud consistency check and interactive repair"`
108108

109109
// Instance management
110110
Logs LogsOpts `command:"logs" description:"Fetch logs from instance(s)"`
@@ -524,12 +524,12 @@ type CloudCheckOpts struct {
524524
}
525525

526526
// Instance management
527-
type VMResurrectionOpts struct {
528-
Args VMResurrectionArgs `positional-args:"true" required:"true"`
527+
type UpdateResurrectionOpts struct {
528+
Args UpdateResurrectionArgs `positional-args:"true" required:"true"`
529529
cmd
530530
}
531531

532-
type VMResurrectionArgs struct {
532+
type UpdateResurrectionArgs struct {
533533
Enabled BoolArg `positional-arg-name:"on|off"`
534534
}
535535

cmd/opts_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ var _ = Describe("Opts", func() {
511511
})
512512
})
513513

514-
Describe("VMResurrection", func() {
514+
Describe("UpdateResurrection", func() {
515515
It("contains desired values", func() {
516-
Expect(getStructTagForName("VMResurrection", opts)).To(Equal(
517-
`command:"vm-resurrection" alias:"vmr" description:"Enable/disable resurrection for a given VM"`,
516+
Expect(getStructTagForName("UpdateResurrection", opts)).To(Equal(
517+
`command:"update-resurrection" description:"Enable/disable resurrection"`,
518518
))
519519
})
520520
})
@@ -1960,11 +1960,11 @@ var _ = Describe("Opts", func() {
19601960
})
19611961
})
19621962

1963-
Describe("VMResurrectionOpts", func() {
1964-
var opts *VMResurrectionOpts
1963+
Describe("UpdateResurrectionOpts", func() {
1964+
var opts *UpdateResurrectionOpts
19651965

19661966
BeforeEach(func() {
1967-
opts = &VMResurrectionOpts{}
1967+
opts = &UpdateResurrectionOpts{}
19681968
})
19691969

19701970
Describe("Tags (these are used by go flags)", func() {
@@ -1980,11 +1980,11 @@ var _ = Describe("Opts", func() {
19801980
})
19811981
})
19821982

1983-
Describe("VMResurrectionArgs", func() {
1984-
var opts *VMResurrectionArgs
1983+
Describe("UpdateResurrectionArgs", func() {
1984+
var opts *UpdateResurrectionArgs
19851985

19861986
BeforeEach(func() {
1987-
opts = &VMResurrectionArgs{}
1987+
opts = &UpdateResurrectionArgs{}
19881988
})
19891989

19901990
Describe("Tags (these are used by go flags)", func() {

cmd/update_resurrection.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package cmd
2+
3+
import (
4+
boshdir "github.com/cloudfoundry/bosh-cli/director"
5+
)
6+
7+
type UpdateResurrectionCmd struct {
8+
director boshdir.Director
9+
}
10+
11+
func NewUpdateResurrectionCmd(director boshdir.Director) UpdateResurrectionCmd {
12+
return UpdateResurrectionCmd{director: director}
13+
}
14+
15+
func (c UpdateResurrectionCmd) Run(opts UpdateResurrectionOpts) error {
16+
return c.director.EnableResurrection(bool(opts.Args.Enabled))
17+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ import (
1010
fakedir "github.com/cloudfoundry/bosh-cli/director/fakes"
1111
)
1212

13-
var _ = Describe("VMResurrectionCmd", func() {
13+
var _ = Describe("UpdateResurrectionCmd", func() {
1414
var (
1515
director *fakedir.FakeDirector
16-
command VMResurrectionCmd
16+
command UpdateResurrectionCmd
1717
)
1818

1919
BeforeEach(func() {
2020
director = &fakedir.FakeDirector{}
21-
command = NewVMResurrectionCmd(director)
21+
command = NewUpdateResurrectionCmd(director)
2222
})
2323

2424
Describe("Run", func() {
2525
var (
26-
opts VMResurrectionOpts
26+
opts UpdateResurrectionOpts
2727
)
2828

2929
BeforeEach(func() {
30-
opts = VMResurrectionOpts{}
30+
opts = UpdateResurrectionOpts{}
3131
})
3232

3333
act := func() error { return command.Run(opts) }

cmd/vm_resurrection.go

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)