summaryrefslogtreecommitdiff
path: root/cmd/podman/images/build.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-09-14 13:46:59 -0700
committerJhon Honce <jhonce@redhat.com>2020-09-14 13:46:59 -0700
commit146c68f3acdc01f393a6cfadf9bc98eec3e8de94 (patch)
tree4e6017e6b64d8fef0c2acb6cd0a3f13545f33b8f /cmd/podman/images/build.go
parentfd7cdb25027bb33c33eacb99f1a02838eca5d684 (diff)
downloadpodman-146c68f3acdc01f393a6cfadf9bc98eec3e8de94.tar.gz
podman-146c68f3acdc01f393a6cfadf9bc98eec3e8de94.tar.bz2
podman-146c68f3acdc01f393a6cfadf9bc98eec3e8de94.zip
Refactor API build endpoint to be more compliant
* Refactor/Rename channel.WriteCloser() to encapsulate the channel * Refactor build endpoint to "live" stream buildah output channels over API rather then buffering output * Refactor bindings/tunnel build because endpoint changes * building tar file now in bindings rather then depending on caller * Cleanup initiating extra image engine * Remove setting fields to zero values (less noise in code) * Update tests to support remote builds Fixes #7136 Fixes #7137 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/images/build.go')
-rw-r--r--cmd/podman/images/build.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index ff5c6ec09..00777c48c 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -206,14 +206,9 @@ func build(cmd *cobra.Command, args []string) error {
}
}
- ie, err := registry.NewImageEngine(cmd, args)
- if err != nil {
- return err
- }
-
var logfile *os.File
if cmd.Flag("logfile").Changed {
- logfile, err = os.OpenFile(buildOpts.Logfile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0600)
+ logfile, err := os.OpenFile(buildOpts.Logfile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0600)
if err != nil {
return errors.Errorf("error opening logfile %q: %v", buildOpts.Logfile, err)
}
@@ -225,7 +220,7 @@ func build(cmd *cobra.Command, args []string) error {
return err
}
- _, err = ie.Build(registry.GetContext(), containerFiles, *apiBuildOpts)
+ _, err = registry.ImageEngine().Build(registry.GetContext(), containerFiles, *apiBuildOpts)
return err
}