summaryrefslogtreecommitdiff
path: root/libpod/sql_state_internal.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2017-11-30 09:37:57 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-12-02 15:32:56 +0000
commitadf8809521733283c364ec7de27c783e324185e8 (patch)
tree427ed0c858ee54e760d0b3691e61765cd7429098 /libpod/sql_state_internal.go
parent1f01faf4375b2dc667b2794e4decdf360d6e32b8 (diff)
downloadpodman-adf8809521733283c364ec7de27c783e324185e8.tar.gz
podman-adf8809521733283c364ec7de27c783e324185e8.tar.bz2
podman-adf8809521733283c364ec7de27c783e324185e8.zip
Add NetMode, UTSMode and IPCMode
Allow kpod create/run to create contianers in different network namespaces, uts namespaces and IPC Namespaces. This patch just handles the simple join the host, or another containers namespaces. Lots more work needed to full integrate --net Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #64 Approved by: mheon
Diffstat (limited to 'libpod/sql_state_internal.go')
-rw-r--r--libpod/sql_state_internal.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/libpod/sql_state_internal.go b/libpod/sql_state_internal.go
index 6e0142b9b..3aee8f638 100644
--- a/libpod/sql_state_internal.go
+++ b/libpod/sql_state_internal.go
@@ -166,7 +166,10 @@ func prepareDB(db *sql.DB) (err error) {
CREATE TABLE IF NOT EXISTS containers(
Id TEXT NOT NULL PRIMARY KEY,
Name TEXT NOT NULL UNIQUE,
+ ProcessLabel TEXT NOT NULL,
MountLabel TEXT NOT NULL,
+ Mounts TEXT NOT NULL,
+ ShmDir TEXT NOT NULL,
StaticDir TEXT NOT NULL,
Stdin INTEGER NOT NULL,
LabelsJSON TEXT NOT NULL,
@@ -267,7 +270,10 @@ func ctrFromScannable(row scannable, runtime *Runtime, specsDir string) (*Contai
var (
id string
name string
+ processLabel string
mountLabel string
+ mounts string
+ shmDir string
staticDir string
stdin int
labelsJSON string
@@ -290,7 +296,10 @@ func ctrFromScannable(row scannable, runtime *Runtime, specsDir string) (*Contai
err := row.Scan(
&id,
&name,
+ &processLabel,
&mountLabel,
+ &mounts,
+ &shmDir,
&staticDir,
&stdin,
&labelsJSON,
@@ -325,7 +334,12 @@ func ctrFromScannable(row scannable, runtime *Runtime, specsDir string) (*Contai
ctr.config.RootfsImageID = rootfsImageID
ctr.config.RootfsImageName = rootfsImageName
ctr.config.UseImageConfig = boolFromSQL(useImageConfig)
+ ctr.config.ProcessLabel = processLabel
ctr.config.MountLabel = mountLabel
+ if err := json.Unmarshal([]byte(mounts), &ctr.config.Mounts); err != nil {
+ return nil, errors.Wrapf(err, "error parsing container %s mounts JSON", id)
+ }
+ ctr.config.ShmDir = shmDir
ctr.config.StaticDir = staticDir
ctr.config.Stdin = boolFromSQL(stdin)
ctr.config.StopSignal = stopSignal