1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

daemon: rename from "delete" job to "rm"

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>
This commit is contained in:
limsy 2014-08-21 03:40:47 -07:00 committed by Oh Jinkyun
parent b1d20c483a
commit 239e932485
5 changed files with 5 additions and 8 deletions

View file

@ -679,7 +679,7 @@ func deleteContainers(eng *engine.Engine, version version.Version, w http.Respon
if vars == nil { if vars == nil {
return fmt.Errorf("Missing parameter") return fmt.Errorf("Missing parameter")
} }
job := eng.Job("delete", vars["name"]) job := eng.Job("rm", vars["name"])
job.Setenv("forceRemove", r.Form.Get("force")) job.Setenv("forceRemove", r.Form.Get("force"))

View file

@ -455,7 +455,7 @@ func TestDeleteContainers(t *testing.T) {
eng := engine.New() eng := engine.New()
name := "foo" name := "foo"
var called bool var called bool
eng.Register("delete", func(job *engine.Job) engine.Status { eng.Register("rm", func(job *engine.Job) engine.Status {
called = true called = true
if len(job.Args) == 0 { if len(job.Args) == 0 {
t.Fatalf("Job arguments is empty") t.Fatalf("Job arguments is empty")

View file

@ -98,8 +98,6 @@ type Daemon struct {
// Install installs daemon capabilities to eng. // Install installs daemon capabilities to eng.
func (daemon *Daemon) Install(eng *engine.Engine) error { func (daemon *Daemon) Install(eng *engine.Engine) error {
// FIXME: rename "delete" to "rm" for consistency with the CLI command
// FIXME: rename ContainerDestroy to ContainerRm for consistency with the CLI command
// FIXME: remove ImageDelete's dependency on Daemon, then move to graph/ // FIXME: remove ImageDelete's dependency on Daemon, then move to graph/
for name, method := range map[string]engine.Handler{ for name, method := range map[string]engine.Handler{
"attach": daemon.ContainerAttach, "attach": daemon.ContainerAttach,
@ -110,7 +108,7 @@ func (daemon *Daemon) Install(eng *engine.Engine) error {
"container_inspect": daemon.ContainerInspect, "container_inspect": daemon.ContainerInspect,
"containers": daemon.Containers, "containers": daemon.Containers,
"create": daemon.ContainerCreate, "create": daemon.ContainerCreate,
"delete": daemon.ContainerDestroy, "rm": daemon.ContainerRm,
"export": daemon.ContainerExport, "export": daemon.ContainerExport,
"info": daemon.CmdInfo, "info": daemon.CmdInfo,
"kill": daemon.ContainerKill, "kill": daemon.ContainerKill,

View file

@ -11,8 +11,7 @@ import (
"github.com/docker/docker/pkg/log" "github.com/docker/docker/pkg/log"
) )
// FIXME: rename to ContainerRemove for consistency with the CLI command. func (daemon *Daemon) ContainerRm(job *engine.Job) engine.Status {
func (daemon *Daemon) ContainerDestroy(job *engine.Job) engine.Status {
if len(job.Args) != 1 { if len(job.Args) != 1 {
return job.Errorf("Not enough arguments. Usage: %s CONTAINER\n", job.Name) return job.Errorf("Not enough arguments. Usage: %s CONTAINER\n", job.Name)
} }

View file

@ -218,7 +218,7 @@ func TestCreateStartRestartStopStartKillRm(t *testing.T) {
} }
// FIXME: this failed once with a race condition ("Unable to remove filesystem for xxx: directory not empty") // FIXME: this failed once with a race condition ("Unable to remove filesystem for xxx: directory not empty")
job = eng.Job("delete", id) job = eng.Job("rm", id)
job.SetenvBool("removeVolume", true) job.SetenvBool("removeVolume", true)
if err := job.Run(); err != nil { if err := job.Run(); err != nil {
t.Fatal(err) t.Fatal(err)