Moved image name into config. runtime.Create() now receives a single Config parameter

This commit is contained in:
Solomon Hykes
2013-03-23 12:39:09 -07:00
parent 031f91df1a
commit 6ce64e8458
5 changed files with 88 additions and 62 deletions
+18 -12
View File
@@ -112,8 +112,9 @@ func TestRuntimeCreate(t *testing.T) {
if len(runtime.List()) != 0 {
t.Errorf("Expected 0 containers, %v found", len(runtime.List()))
}
container, err := runtime.Create(GetTestImage(runtime).Id, &Config{
Cmd: []string{"ls", "-al"},
container, err := runtime.Create(&Config{
Image: GetTestImage(runtime).Id,
Cmd: []string{"ls", "-al"},
},
)
if err != nil {
@@ -158,8 +159,9 @@ func TestDestroy(t *testing.T) {
t.Fatal(err)
}
defer nuke(runtime)
container, err := runtime.Create(GetTestImage(runtime).Id, &Config{
Cmd: []string{"ls", "-al"},
container, err := runtime.Create(&Config{
Image: GetTestImage(runtime).Id,
Cmd: []string{"ls", "-al"},
},
)
if err != nil {
@@ -204,8 +206,9 @@ func TestGet(t *testing.T) {
t.Fatal(err)
}
defer nuke(runtime)
container1, err := runtime.Create(GetTestImage(runtime).Id, &Config{
Cmd: []string{"ls", "-al"},
container1, err := runtime.Create(&Config{
Image: GetTestImage(runtime).Id,
Cmd: []string{"ls", "-al"},
},
)
if err != nil {
@@ -213,8 +216,9 @@ func TestGet(t *testing.T) {
}
defer runtime.Destroy(container1)
container2, err := runtime.Create(GetTestImage(runtime).Id, &Config{
Cmd: []string{"ls", "-al"},
container2, err := runtime.Create(&Config{
Image: GetTestImage(runtime).Id,
Cmd: []string{"ls", "-al"},
},
)
if err != nil {
@@ -222,8 +226,9 @@ func TestGet(t *testing.T) {
}
defer runtime.Destroy(container2)
container3, err := runtime.Create(GetTestImage(runtime).Id, &Config{
Cmd: []string{"ls", "-al"},
container3, err := runtime.Create(&Config{
Image: GetTestImage(runtime).Id,
Cmd: []string{"ls", "-al"},
},
)
if err != nil {
@@ -264,8 +269,9 @@ func TestRestore(t *testing.T) {
}
// Create a container with one instance of docker
container1, err := runtime1.Create(GetTestImage(runtime1).Id, &Config{
Cmd: []string{"ls", "-al"},
container1, err := runtime1.Create(&Config{
Image: GetTestImage(runtime1).Id,
Cmd: []string{"ls", "-al"},
},
)
if err != nil {