Skip to content

Commit

Permalink
Merge pull request #1034 from ZouRui89/create
Browse files Browse the repository at this point in the history
bugfix: change container create output
  • Loading branch information
allencloud authored Apr 3, 2018
2 parents 46c67ec + 58d04c9 commit 126105b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cli/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ func (cc *CreateCommand) runCreate(args []string) error {
if len(result.Warnings) != 0 {
fmt.Printf("WARNING: %s \n", strings.Join(result.Warnings, "\n"))
}
fmt.Printf("container ID: %s, name: %s \n", result.ID, result.Name)
fmt.Printf(result.ID)
return nil
}

// createExample shows examples in create command, and is used in auto-generated cli docs.
func createExample() string {
return `$ pouch create --name foo busybox:latest
container ID: e1d541722d68dc5d133cca9e7bd8fd9338603e1763096c8e853522b60d11f7b9, name: foo`
e1d541722d68dc5d133cca9e7bd8fd9338603e1763096c8e853522b60d11f7b9`
}
8 changes: 2 additions & 6 deletions test/cli_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/go-check/check"
"github.com/gotestyourself/gotestyourself/icmd"
"github.com/stretchr/testify/assert"
)

// PouchCreateSuite is the test suite for create CLI.
Expand Down Expand Up @@ -39,9 +40,6 @@ func (suite *PouchCreateSuite) TestCreateName(c *check.C) {
res := command.PouchRun("create", "--name", name, busyboxImage)

res.Assert(c, icmd.Success)
if out := res.Combined(); !strings.Contains(out, name) {
c.Fatalf("unexpected output %s expected %s\n", out, name)
}

defer DelContainerForceMultyTime(c, name)
}
Expand All @@ -57,9 +55,7 @@ func (suite *PouchCreateSuite) TestCreateNameByImageID(c *check.C) {
res = command.PouchRun("create", "--name", name, imageID)

res.Assert(c, icmd.Success)
if out := res.Combined(); !strings.Contains(out, name) {
c.Fatalf("unexpected output %s expected %s\n", out, name)
}
assert.Equal(c, len(res.Combined()), 64)

DelContainerForceMultyTime(c, name)
}
Expand Down

0 comments on commit 126105b

Please sign in to comment.