diff options
author | louis <louis@localhost.localdomain> | 2020-07-20 16:34:59 -0400 |
---|---|---|
committer | ldelossa <ldelossa@redhat.com> | 2020-07-23 10:18:14 -0400 |
commit | 10c4ab11497dd78351674ec7774be65dddea463d (patch) | |
tree | 63bcc4c2137ce586862e70b05c516ba535987e6d /libpod/common_test.go | |
parent | 1aac197f79e91b06ec7e948bd73bb2464e8a508f (diff) | |
download | podman-10c4ab11497dd78351674ec7774be65dddea463d.tar.gz podman-10c4ab11497dd78351674ec7774be65dddea463d.tar.bz2 podman-10c4ab11497dd78351674ec7774be65dddea463d.zip |
Refactor container config
This commit handle the TODO task of breaking the Container
config into smaller sub-configs
Signed-off-by: ldelossa <ldelossa@redhat.com>
Diffstat (limited to 'libpod/common_test.go')
-rw-r--r-- | libpod/common_test.go | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/libpod/common_test.go b/libpod/common_test.go index dff04af5c..e15e3e7a7 100644 --- a/libpod/common_test.go +++ b/libpod/common_test.go @@ -19,33 +19,41 @@ import ( func getTestContainer(id, name string, manager lock.Manager) (*Container, error) { ctr := &Container{ config: &ContainerConfig{ - ID: id, - Name: name, - RootfsImageID: id, - RootfsImageName: "testimg", - StaticDir: "/does/not/exist/", - LogPath: "/does/not/exist/", - Stdin: true, - Labels: map[string]string{"a": "b", "c": "d"}, - StopSignal: 0, - StopTimeout: 0, - CreatedTime: time.Now(), - Privileged: true, - Mounts: []string{"/does/not/exist"}, - DNSServer: []net.IP{net.ParseIP("192.168.1.1"), net.ParseIP("192.168.2.2")}, - DNSSearch: []string{"example.com", "example.example.com"}, - PortMappings: []ocicni.PortMapping{ - { - HostPort: 80, - ContainerPort: 90, - Protocol: "tcp", - HostIP: "192.168.3.3", - }, - { - HostPort: 100, - ContainerPort: 110, - Protocol: "udp", - HostIP: "192.168.4.4", + ID: id, + Name: name, + ContainerRootFSConfig: ContainerRootFSConfig{ + RootfsImageID: id, + RootfsImageName: "testimg", + StaticDir: "/does/not/exist/", + Mounts: []string{"/does/not/exist"}, + }, + ContainerMiscConfig: ContainerMiscConfig{ + LogPath: "/does/not/exist/", + Stdin: true, + Labels: map[string]string{"a": "b", "c": "d"}, + StopSignal: 0, + StopTimeout: 0, + CreatedTime: time.Now(), + }, + ContainerSecurityConfig: ContainerSecurityConfig{ + Privileged: true, + }, + ContainerNetworkConfig: ContainerNetworkConfig{ + DNSServer: []net.IP{net.ParseIP("192.168.1.1"), net.ParseIP("192.168.2.2")}, + DNSSearch: []string{"example.com", "example.example.com"}, + PortMappings: []ocicni.PortMapping{ + { + HostPort: 80, + ContainerPort: 90, + Protocol: "tcp", + HostIP: "192.168.3.3", + }, + { + HostPort: 100, + ContainerPort: 110, + Protocol: "udp", + HostIP: "192.168.4.4", + }, }, }, }, |