Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: change container create output #1034

Merged
merged 1 commit into from
Apr 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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