varlink build

Add the endpoint and methods for build so users can build an image
with varlink.  build can also use the more method for streaming
output back more regularily; however, it looks like a bug in buildah
does not output all build output to the writer provided.

Tidy up some create fixes and add endpoint for GetImage requested by
jhonce.

Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
baude
2018-05-29 09:57:06 -05:00
parent ff3b46e769
commit 62ea88fa19
5 changed files with 337 additions and 30 deletions

View File

@ -22,14 +22,6 @@ import (
// CreateContainer ...
func (i *LibpodAPI) CreateContainer(call ioprojectatomicpodman.VarlinkCall, config ioprojectatomicpodman.Create) error {
//mappings, err := util.ParseIDMapping(config.Uidmap, config.Gidmap, config.Subuidmap, config.Subgidmap)
//if err != nil {
// return err
//}
//storageOpts := storage.DefaultStoreOptions
//storageOpts.UIDMap = mappings.UIDMap
//storageOpts.GIDMap = mappings.GIDMap
runtime, err := libpodruntime.GetRuntime(i.Cli)
if err != nil {
return call.ReplyRuntimeError(err.Error())
@ -120,7 +112,7 @@ func varlinkCreateToCreateConfig(ctx context.Context, create ioprojectatomicpodm
if len(inputCommand) > 0 {
// User command overrides data CMD
command = append(command, inputCommand...)
} else if len(data.ContainerConfig.Cmd) > 0 && len(create.Entrypoint) > 0 {
} else if len(data.ContainerConfig.Cmd) > 0 && len(command) == 0 {
// If not user command, add CMD
command = append(command, data.ContainerConfig.Cmd...)
}