Merge pull request #3888 from jwhonce/wip/api

Update varlink doc and code for images
This commit is contained in:
OpenShift Merge Robot
2019-08-27 11:43:24 +02:00
committed by GitHub
4 changed files with 17 additions and 6 deletions

2
API.md
View File

@ -1361,6 +1361,8 @@ pids [int](https://godoc.org/builtin#int)
### <a name="Create"></a>type Create
Create is an input structure for creating containers.
args[0] is the image name or id
args[1-] are the new commands if changed
args [[]string](#[]string)

View File

@ -81,7 +81,7 @@ func CreateContainer(ctx context.Context, c *GenericCLIResults, runtime *libpod.
if len(c.InputArgs) != 0 {
name = c.InputArgs[0]
} else {
return nil, nil, errors.Errorf("error, no input arguments were provided")
return nil, nil, errors.Errorf("error, image name not provided")
}
pullType, err := util.ValidatePullType(c.String("pull"))

View File

@ -274,6 +274,8 @@ type Sockets(
)
# Create is an input structure for creating containers.
# args[0] is the image name or id
# args[1-] are the new commands if changed
type Create (
args: []string,
addHost: ?[]string,

View File

@ -360,7 +360,12 @@ func (i *LibpodAPI) PushImage(call iopodman.VarlinkCall, name, tag string, compr
output := bytes.NewBuffer([]byte{})
c := make(chan error)
go func() {
err := newImage.PushImageToHeuristicDestination(getContext(), destname, manifestType, "", "", "", output, compress, so, &dockerRegistryOptions, nil)
writer := bytes.NewBuffer([]byte{})
err := newImage.PushImageToHeuristicDestination(getContext(), destname, manifestType, "", "", "", writer, compress, so, &dockerRegistryOptions, nil)
if err != nil {
c <- err
}
_, err = io.CopyBuffer(output, writer, nil)
c <- err
close(c)
}()
@ -388,6 +393,7 @@ func (i *LibpodAPI) PushImage(call iopodman.VarlinkCall, name, tag string, compr
}
br := iopodman.MoreResponse{
Logs: log,
Id: newImage.ID(),
}
call.ReplyPushImage(br)
log = []string{}
@ -403,6 +409,7 @@ func (i *LibpodAPI) PushImage(call iopodman.VarlinkCall, name, tag string, compr
br := iopodman.MoreResponse{
Logs: log,
Id: newImage.ID(),
}
return call.ReplyPushImage(br)
}