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

Add changes to import image #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion dockerclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ func (client *DockerClient) RenameContainer(oldName string, newName string) erro
return err
}

func (client *DockerClient) ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error) {
func (client *DockerClient) ImportImage(source string, repository string, tag string, changes *[]string, tar io.Reader) (io.ReadCloser, error) {
var fromSrc string
v := &url.Values{}
if source == "" {
Expand All @@ -594,6 +594,9 @@ func (client *DockerClient) ImportImage(source string, repository string, tag st
if tag != "" {
v.Set("tag", tag)
}
for _, change := range *changes {
v.Add("changes", change)
}

var in io.Reader
if fromSrc == "-" {
Expand Down
2 changes: 1 addition & 1 deletion interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ type Client interface {
PauseContainer(name string) error
UnpauseContainer(name string) error
RenameContainer(oldName string, newName string) error
ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error)
ImportImage(source string, repository string, tag string, changes *[]string, tar io.Reader) (io.ReadCloser, error)
}
4 changes: 2 additions & 2 deletions mockclient/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (client *MockClient) RenameContainer(oldName string, newName string) error
return args.Error(0)
}

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