diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2017-11-30 09:37:57 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-12-02 15:32:56 +0000 |
commit | adf8809521733283c364ec7de27c783e324185e8 (patch) | |
tree | 427ed0c858ee54e760d0b3691e61765cd7429098 /libpod/sql_state.go | |
parent | 1f01faf4375b2dc667b2794e4decdf360d6e32b8 (diff) | |
download | podman-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.go')
-rw-r--r-- | libpod/sql_state.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libpod/sql_state.go b/libpod/sql_state.go index 7c2061fca..fb6be85d7 100644 --- a/libpod/sql_state.go +++ b/libpod/sql_state.go @@ -16,7 +16,7 @@ import ( // DBSchema is the current DB schema version // Increments every time a change is made to the database's tables -const DBSchema = 1 +const DBSchema = 2 // SQLState is a state implementation backed by a persistent SQLite3 database type SQLState struct { @@ -230,7 +230,7 @@ func (s *SQLState) HasContainer(id string) (bool, error) { func (s *SQLState) AddContainer(ctr *Container) (err error) { const ( addCtr = `INSERT INTO containers VALUES ( - ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? + ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? );` addCtrState = `INSERT INTO containerState VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? @@ -265,11 +265,18 @@ func (s *SQLState) AddContainer(ctr *Container) (err error) { } }() + mounts, err := json.Marshal(ctr.config.Mounts) + if err != nil { + return errors.Wrapf(err, "error marshaling container %s monunts to JSON", ctr.ID()) + } // Add static container information _, err = tx.Exec(addCtr, ctr.ID(), ctr.Name(), + ctr.config.ProcessLabel, ctr.config.MountLabel, + string(mounts), + ctr.config.ShmDir, ctr.config.StaticDir, boolToSQL(ctr.config.Stdin), string(labelsJSON), |