This commit fixes following FIXMEs:
// FIXME: rename "delete" to "rm" for consistency with the CLI command
// FIXME: rename ContainerDestroy to ContainerRm for consistency with the CLI command
Signed-off-by: lim seong yeol <seongyeol37@gmail.com>
| ... | ... |
@@ -679,7 +679,7 @@ func deleteContainers(eng *engine.Engine, version version.Version, w http.Respon |
| 679 | 679 |
if vars == nil {
|
| 680 | 680 |
return fmt.Errorf("Missing parameter")
|
| 681 | 681 |
} |
| 682 |
- job := eng.Job("delete", vars["name"])
|
|
| 682 |
+ job := eng.Job("rm", vars["name"])
|
|
| 683 | 683 |
|
| 684 | 684 |
job.Setenv("forceRemove", r.Form.Get("force"))
|
| 685 | 685 |
|
| ... | ... |
@@ -455,7 +455,7 @@ func TestDeleteContainers(t *testing.T) {
|
| 455 | 455 |
eng := engine.New() |
| 456 | 456 |
name := "foo" |
| 457 | 457 |
var called bool |
| 458 |
- eng.Register("delete", func(job *engine.Job) engine.Status {
|
|
| 458 |
+ eng.Register("rm", func(job *engine.Job) engine.Status {
|
|
| 459 | 459 |
called = true |
| 460 | 460 |
if len(job.Args) == 0 {
|
| 461 | 461 |
t.Fatalf("Job arguments is empty")
|
| ... | ... |
@@ -98,8 +98,6 @@ type Daemon struct {
|
| 98 | 98 |
|
| 99 | 99 |
// Install installs daemon capabilities to eng. |
| 100 | 100 |
func (daemon *Daemon) Install(eng *engine.Engine) error {
|
| 101 |
- // FIXME: rename "delete" to "rm" for consistency with the CLI command |
|
| 102 |
- // FIXME: rename ContainerDestroy to ContainerRm for consistency with the CLI command |
|
| 103 | 101 |
// FIXME: remove ImageDelete's dependency on Daemon, then move to graph/ |
| 104 | 102 |
for name, method := range map[string]engine.Handler{
|
| 105 | 103 |
"attach": daemon.ContainerAttach, |
| ... | ... |
@@ -110,7 +108,7 @@ func (daemon *Daemon) Install(eng *engine.Engine) error {
|
| 110 | 110 |
"container_inspect": daemon.ContainerInspect, |
| 111 | 111 |
"containers": daemon.Containers, |
| 112 | 112 |
"create": daemon.ContainerCreate, |
| 113 |
- "delete": daemon.ContainerDestroy, |
|
| 113 |
+ "rm": daemon.ContainerRm, |
|
| 114 | 114 |
"export": daemon.ContainerExport, |
| 115 | 115 |
"info": daemon.CmdInfo, |
| 116 | 116 |
"kill": daemon.ContainerKill, |
| ... | ... |
@@ -11,8 +11,7 @@ import ( |
| 11 | 11 |
"github.com/docker/docker/pkg/log" |
| 12 | 12 |
) |
| 13 | 13 |
|
| 14 |
-// FIXME: rename to ContainerRemove for consistency with the CLI command. |
|
| 15 |
-func (daemon *Daemon) ContainerDestroy(job *engine.Job) engine.Status {
|
|
| 14 |
+func (daemon *Daemon) ContainerRm(job *engine.Job) engine.Status {
|
|
| 16 | 15 |
if len(job.Args) != 1 {
|
| 17 | 16 |
return job.Errorf("Not enough arguments. Usage: %s CONTAINER\n", job.Name)
|
| 18 | 17 |
} |
| ... | ... |
@@ -218,7 +218,7 @@ func TestCreateStartRestartStopStartKillRm(t *testing.T) {
|
| 218 | 218 |
} |
| 219 | 219 |
|
| 220 | 220 |
// FIXME: this failed once with a race condition ("Unable to remove filesystem for xxx: directory not empty")
|
| 221 |
- job = eng.Job("delete", id)
|
|
| 221 |
+ job = eng.Job("rm", id)
|
|
| 222 | 222 |
job.SetenvBool("removeVolume", true)
|
| 223 | 223 |
if err := job.Run(); err != nil {
|
| 224 | 224 |
t.Fatal(err) |