summaryrefslogtreecommitdiff
path: root/libpod/oci.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-06-13 15:25:23 +0200
committerGitHub <noreply@github.com>2019-06-13 15:25:23 +0200
commitf628a97be5b142878ab624776505aed315607f12 (patch)
treedd21a1e14c8895d01cbf8ce8ac193dc33e2f7917 /libpod/oci.go
parent77d1cf0a3288da0459c92790a0c2dddf8a68242e (diff)
parent13e1afdb02592ab4b0e4e7fb936c76f5c7dda20a (diff)
downloadpodman-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/oci.go')
-rw-r--r--libpod/oci.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/libpod/oci.go b/libpod/oci.go
index 7138108c5..dcb72fc1b 100644
--- a/libpod/oci.go
+++ b/libpod/oci.go
@@ -58,6 +58,7 @@ type OCIRuntime struct {
logSizeMax int64
noPivot bool
reservePorts bool
+ supportsJSON bool
}
// syncInfo is used to return data from monitor process to daemon
@@ -66,8 +67,16 @@ type syncInfo struct {
Message string `json:"message,omitempty"`
}
+// ociError is used to parse the OCI runtime JSON log. It is not part of the
+// OCI runtime specifications, it follows what runc does
+type ociError struct {
+ Level string `json:"level,omitempty"`
+ Time string `json:"time,omitempty"`
+ Msg string `json:"msg,omitempty"`
+}
+
// Make a new OCI runtime with provided options
-func newOCIRuntime(oruntime OCIRuntimePath, conmonPath string, conmonEnv []string, cgroupManager string, tmpDir string, logSizeMax int64, noPivotRoot bool, reservePorts bool) (*OCIRuntime, error) {
+func newOCIRuntime(oruntime OCIRuntimePath, conmonPath string, conmonEnv []string, cgroupManager string, tmpDir string, logSizeMax int64, noPivotRoot bool, reservePorts bool, supportsJSON bool) (*OCIRuntime, error) {
runtime := new(OCIRuntime)
runtime.name = oruntime.Name
runtime.path = oruntime.Paths[0]
@@ -78,6 +87,7 @@ func newOCIRuntime(oruntime OCIRuntimePath, conmonPath string, conmonEnv []strin
runtime.logSizeMax = logSizeMax
runtime.noPivot = noPivotRoot
runtime.reservePorts = reservePorts
+ runtime.supportsJSON = supportsJSON
runtime.exitsDir = filepath.Join(runtime.tmpDir, "exits")
runtime.socketsDir = filepath.Join(runtime.tmpDir, "socket")