diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-01-10 21:28:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-10 21:28:05 +0100 |
commit | e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9 (patch) | |
tree | 61134dad4b2efdaa65dee6e7206e5ce20080302c /libpod/runtime_img.go | |
parent | 6ed88e047579bd2d1eac99a6089cc617f0c4773d (diff) | |
parent | 986feef2e80cfaed7cbce0df4fd5d619bcffefd7 (diff) | |
download | podman-e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9.tar.gz podman-e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9.tar.bz2 podman-e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9.zip |
Merge pull request #4832 from baude/apiv2tomaster
Apiv2tomaster
Diffstat (limited to 'libpod/runtime_img.go')
-rw-r--r-- | libpod/runtime_img.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go index 9943c4104..bae1c1ed8 100644 --- a/libpod/runtime_img.go +++ b/libpod/runtime_img.go @@ -10,6 +10,7 @@ import ( "os" "github.com/containers/buildah/imagebuildah" + "github.com/containers/image/v5/docker/reference" "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/libpod/image" "github.com/containers/libpod/pkg/util" @@ -145,9 +146,9 @@ func removeStorageContainers(ctrIDs []string, store storage.Store) error { } // Build adds the runtime to the imagebuildah call -func (r *Runtime) Build(ctx context.Context, options imagebuildah.BuildOptions, dockerfiles ...string) error { - _, _, err := imagebuildah.BuildDockerfiles(ctx, r.store, options, dockerfiles...) - return err +func (r *Runtime) Build(ctx context.Context, options imagebuildah.BuildOptions, dockerfiles ...string) (string, reference.Canonical, error) { + id, ref, err := imagebuildah.BuildDockerfiles(ctx, r.store, options, dockerfiles...) + return id, ref, err } // Import is called as an intermediary to the image library Import @@ -192,7 +193,7 @@ func (r *Runtime) Import(ctx context.Context, source string, reference string, c } // if it's stdin, buffer it, too if source == "-" { - file, err := downloadFromFile(os.Stdin) + file, err := DownloadFromFile(os.Stdin) if err != nil { return "", err } @@ -232,9 +233,9 @@ func downloadFromURL(source string) (string, error) { return outFile.Name(), nil } -// donwloadFromFile reads all of the content from the reader and temporarily +// DownloadFromFile reads all of the content from the reader and temporarily // saves in it /var/tmp/importxyz, which is deleted after the image is imported -func downloadFromFile(reader *os.File) (string, error) { +func DownloadFromFile(reader *os.File) (string, error) { outFile, err := ioutil.TempFile("/var/tmp", "import") if err != nil { return "", errors.Wrap(err, "error creating file") |