diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-06-13 15:25:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-13 15:25:23 +0200 |
commit | f628a97be5b142878ab624776505aed315607f12 (patch) | |
tree | dd21a1e14c8895d01cbf8ce8ac193dc33e2f7917 /libpod/runtime.go | |
parent | 77d1cf0a3288da0459c92790a0c2dddf8a68242e (diff) | |
parent | 13e1afdb02592ab4b0e4e7fb936c76f5c7dda20a (diff) | |
download | podman-f628a97be5b142878ab624776505aed315607f12.tar.gz podman-f628a97be5b142878ab624776505aed315607f12.tar.bz2 podman-f628a97be5b142878ab624776505aed315607f12.zip |
Merge pull request #3311 from giuseppe/oci-errors
oci: use json formatted errors from the runtime
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 098607b63..24bb5f61c 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -151,6 +151,8 @@ type RuntimeConfig struct { OCIRuntime string `toml:"runtime"` // OCIRuntimes are the set of configured OCI runtimes (default is runc) OCIRuntimes map[string][]string `toml:"runtimes"` + // RuntimeSupportsJSON is the list of the OCI runtimes that support --format=json + RuntimeSupportsJSON []string `toml:"runtime_supports_json"` // RuntimePath is the path to OCI runtime binary for launching // containers. // The first path pointing to a valid file will be used @@ -830,12 +832,21 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (err error) { } } + supportsJSON := false + for _, r := range runtime.config.RuntimeSupportsJSON { + if r == runtime.config.OCIRuntime { + supportsJSON = true + break + } + } + // Make an OCI runtime to perform container operations ociRuntime, err := newOCIRuntime(runtime.ociRuntimePath, runtime.conmonPath, runtime.config.ConmonEnvVars, runtime.config.CgroupManager, runtime.config.TmpDir, runtime.config.MaxLogSize, runtime.config.NoPivotRoot, - runtime.config.EnablePortReservation) + runtime.config.EnablePortReservation, + supportsJSON) if err != nil { return err } |