diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-02-14 15:40:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-14 15:40:52 +0100 |
commit | 0cd22435964573231ab32e545d5f319821b35b14 (patch) | |
tree | 4325f9e495b6761b64d984ec32ebf0c8b9cca185 /pkg/varlinkapi/util.go | |
parent | dfc64e15d7f8b1715798fd68bd3ff74ae192b354 (diff) | |
parent | ef85dd7950800fdce9ab58724921507cba31004b (diff) | |
download | podman-0cd22435964573231ab32e545d5f319821b35b14.tar.gz podman-0cd22435964573231ab32e545d5f319821b35b14.tar.bz2 podman-0cd22435964573231ab32e545d5f319821b35b14.zip |
Merge pull request #2321 from baude/remotebuild
podman-remote build
Diffstat (limited to 'pkg/varlinkapi/util.go')
-rw-r--r-- | pkg/varlinkapi/util.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pkg/varlinkapi/util.go b/pkg/varlinkapi/util.go index 7f6f95d3b..7e487c03a 100644 --- a/pkg/varlinkapi/util.go +++ b/pkg/varlinkapi/util.go @@ -3,11 +3,14 @@ package varlinkapi import ( "context" "strconv" + "strings" "time" + "github.com/containers/buildah" "github.com/containers/libpod/cmd/podman/shared" "github.com/containers/libpod/cmd/podman/varlink" "github.com/containers/libpod/libpod" + "github.com/containers/storage/pkg/archive" ) // getContext returns a non-nil, empty context @@ -133,3 +136,27 @@ func handlePodCall(call iopodman.VarlinkCall, pod *libpod.Pod, ctrErrs map[strin return nil } + +func stringCompressionToArchiveType(s string) archive.Compression { + switch strings.ToUpper(s) { + case "BZIP2": + return archive.Bzip2 + case "GZIP": + return archive.Gzip + case "XZ": + return archive.Xz + } + return archive.Uncompressed +} + +func stringPullPolicyToType(s string) buildah.PullPolicy { + switch strings.ToUpper(s) { + case "PULLIFMISSING": + return buildah.PullIfMissing + case "PULLALWAYS": + return buildah.PullAlways + case "PULLNEVER": + return buildah.PullNever + } + return buildah.PullIfMissing +} |