|
@@ -2,7 +2,6 @@ package image
|
|
|
|
|
|
import (
|
|
import (
|
|
"archive/tar"
|
|
"archive/tar"
|
|
- "context"
|
|
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"io"
|
|
"io"
|
|
"io/fs"
|
|
"io/fs"
|
|
@@ -86,24 +85,11 @@ func TestSaveRepoWithMultipleImages(t *testing.T) {
|
|
client := testEnv.APIClient()
|
|
client := testEnv.APIClient()
|
|
|
|
|
|
makeImage := func(from string, tag string) string {
|
|
makeImage := func(from string, tag string) string {
|
|
- id := container.Run(ctx, t, client, func(cfg *container.TestContainerConfig) {
|
|
|
|
|
|
+ id := container.Create(ctx, t, client, func(cfg *container.TestContainerConfig) {
|
|
cfg.Config.Image = from
|
|
cfg.Config.Image = from
|
|
cfg.Config.Cmd = []string{"true"}
|
|
cfg.Config.Cmd = []string{"true"}
|
|
})
|
|
})
|
|
|
|
|
|
- chW, chErr := client.ContainerWait(ctx, id, containertypes.WaitConditionNotRunning)
|
|
|
|
-
|
|
|
|
- ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
|
|
|
|
- defer cancel()
|
|
|
|
-
|
|
|
|
- select {
|
|
|
|
- case <-chW:
|
|
|
|
- case err := <-chErr:
|
|
|
|
- assert.NilError(t, err)
|
|
|
|
- case <-ctx.Done():
|
|
|
|
- t.Fatal("timeout waiting for container to exit")
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
res, err := client.ContainerCommit(ctx, id, containertypes.CommitOptions{Reference: tag})
|
|
res, err := client.ContainerCommit(ctx, id, containertypes.CommitOptions{Reference: tag})
|
|
assert.NilError(t, err)
|
|
assert.NilError(t, err)
|
|
|
|
|