From 4f699db8dad05b770b4e02d3de67137517c3463b Mon Sep 17 00:00:00 2001 From: baude Date: Thu, 12 Jul 2018 09:51:31 -0500 Subject: Support multiple networks This is a refresh of Dan William's PR #974 with a rebase and proper vendoring of ocicni and containernetworking/cni. It adds the ability to define multiple networks as so: podman run --network=net1,net2,foobar ... Signed-off-by: baude Closes: #1082 Approved by: baude --- libpod/runtime.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libpod/runtime.go') diff --git a/libpod/runtime.go b/libpod/runtime.go index ce64f0d5b..9ba6acb78 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -134,6 +134,9 @@ type RuntimeConfig struct { CNIPluginDir []string `toml:"cni_plugin_dir"` // HooksDir Path to the directory containing hooks configuration files HooksDir string `toml:"hooks_dir"` + // CNIDefaultNetwork is the network name of the default CNI network + // to attach pods to + CNIDefaultNetwork string `toml:"cni_default_network,omitempty"` // HooksDirNotExistFatal switches between fatal errors and non-fatal warnings if the configured HooksDir does not exist. HooksDirNotExistFatal bool `toml:"hooks_dir_not_exist_fatal"` // DefaultMountsFile is the path to the default mounts file for testing purposes only @@ -442,7 +445,7 @@ func makeRuntime(runtime *Runtime) (err error) { } // Set up the CNI net plugin - netPlugin, err := ocicni.InitCNI(runtime.config.CNIConfigDir, runtime.config.CNIPluginDir...) + netPlugin, err := ocicni.InitCNI(runtime.config.CNIDefaultNetwork, runtime.config.CNIConfigDir, runtime.config.CNIPluginDir...) if err != nil { return errors.Wrapf(err, "error configuring CNI network plugin") } -- cgit v1.2.3-54-g00ecf