Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

Commit f60e64c

Browse files
committed
Add changes to import image
1 parent 142d8fe commit f60e64c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

dockerclient.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ func (client *DockerClient) RenameContainer(oldName string, newName string) erro
580580
return err
581581
}
582582

583-
func (client *DockerClient) ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error) {
583+
func (client *DockerClient) ImportImage(source string, repository string, tag string, changes *[]string, tar io.Reader) (io.ReadCloser, error) {
584584
var fromSrc string
585585
v := &url.Values{}
586586
if source == "" {
@@ -594,6 +594,9 @@ func (client *DockerClient) ImportImage(source string, repository string, tag st
594594
if tag != "" {
595595
v.Set("tag", tag)
596596
}
597+
for _, change := range *changes {
598+
v.Add("changes", change)
599+
}
597600

598601
var in io.Reader
599602
if fromSrc == "-" {

interface.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ type Client interface {
4040
PauseContainer(name string) error
4141
UnpauseContainer(name string) error
4242
RenameContainer(oldName string, newName string) error
43-
ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error)
43+
ImportImage(source string, repository string, tag string, changes *[]string, tar io.Reader) (io.ReadCloser, error)
4444
}

mockclient/mock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (client *MockClient) RenameContainer(oldName string, newName string) error
146146
return args.Error(0)
147147
}
148148

149-
func (client *MockClient) ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error) {
150-
args := client.Mock.Called(source, repository, tag, tar)
149+
func (client *MockClient) ImportImage(source string, repository string, tag string, changes *[]string, tar io.Reader) (io.ReadCloser, error) {
150+
args := client.Mock.Called(source, repository, tag, changes, tar)
151151
return args.Get(0).(io.ReadCloser), args.Error(1)
152152
}

0 commit comments

Comments
 (0)