diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-26 21:31:06 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-28 09:21:59 +0100 |
commit | 95f22a2ca055d6dec0281cee109375dc4fd9b78b (patch) | |
tree | fb916a4b5e4960cada05db5c57f2aae5175009f2 /libpod/container_easyjson.go | |
parent | 4203df69aca13f14e43ad32a9b7ffb6cfb8c1016 (diff) | |
download | podman-95f22a2ca055d6dec0281cee109375dc4fd9b78b.tar.gz podman-95f22a2ca055d6dec0281cee109375dc4fd9b78b.tar.bz2 podman-95f22a2ca055d6dec0281cee109375dc4fd9b78b.zip |
network: allow slirp4netns mode also for root containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/container_easyjson.go')
-rw-r--r-- | libpod/container_easyjson.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/container_easyjson.go b/libpod/container_easyjson.go index 041cc08ac..8bf5cb64f 100644 --- a/libpod/container_easyjson.go +++ b/libpod/container_easyjson.go @@ -8,6 +8,7 @@ import ( json "encoding/json" types "github.com/containernetworking/cni/pkg/types" current "github.com/containernetworking/cni/pkg/types/current" + namespaces "github.com/containers/libpod/pkg/namespaces" storage "github.com/containers/storage" idtools "github.com/containers/storage/pkg/idtools" ocicni "github.com/cri-o/ocicni/pkg/ocicni" @@ -1550,6 +1551,8 @@ func easyjson1dbef17bDecodeGithubComContainersLibpodLibpod2(in *jlexer.Lexer, ou } in.Delim(']') } + case "networkMode": + out.NetMode = namespaces.NetworkMode(in.String()) case "userVolumes": if in.IsNull() { in.Skip() @@ -2177,6 +2180,16 @@ func easyjson1dbef17bEncodeGithubComContainersLibpodLibpod2(out *jwriter.Writer, out.RawByte(']') } } + if in.NetMode != "" { + const prefix string = ",\"networkMode\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.NetMode)) + } if len(in.UserVolumes) != 0 { const prefix string = ",\"userVolumes\":" if first { |