From 840eb04e03e9292c54621c7ff75cbf95e690d86f Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 8 Dec 2017 15:11:14 -0500 Subject: Add iptables integration to network code Signed-off-by: Matthew Heon Closes: #109 Approved by: mheon --- libpod/runtime.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'libpod/runtime.go') diff --git a/libpod/runtime.go b/libpod/runtime.go index 9712b6dd3..480da6677 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -12,6 +12,7 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/ulule/deepcopier" + "k8s.io/kubernetes/pkg/kubelet/network/hostport" ) // A RuntimeOption is a functional option which alters the Runtime created by @@ -20,16 +21,17 @@ type RuntimeOption func(*Runtime) error // Runtime is the core libpod runtime type Runtime struct { - config *RuntimeConfig - state State - store storage.Store - storageService *storageService - imageContext *types.SystemContext - ociRuntime *OCIRuntime - lockDir string - netPlugin ocicni.CNIPlugin - valid bool - lock sync.RWMutex + config *RuntimeConfig + state State + store storage.Store + storageService *storageService + imageContext *types.SystemContext + ociRuntime *OCIRuntime + lockDir string + netPlugin ocicni.CNIPlugin + hostportManager hostport.HostPortManager + valid bool + lock sync.RWMutex } // RuntimeConfig contains configuration options used to set up the runtime @@ -170,7 +172,8 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) { } runtime.netPlugin = netPlugin - // TODO: iptables/firewalld integration to ensure rules are in place for forwarding + // Set up the hostport manager + runtime.hostportManager = hostport.NewHostportManager() // Set up the state if runtime.config.InMemoryState { -- cgit v1.2.3-54-g00ecf