From 51997775bd4251f73b4fd1a924ba8738229dc687 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Mon, 29 Oct 2018 09:10:17 -0700 Subject: [PATCH] virtcontainers: Rely on new interface LinkType field Now that Interface structure includes the useful information about the type of interface, Kata does not need to do any assumption about the type of interface that needs to be added. Fixes #866 Signed-off-by: Sebastien Boeuf --- virtcontainers/sandbox.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/virtcontainers/sandbox.go b/virtcontainers/sandbox.go index 8746e6eeba..3d723e0042 100644 --- a/virtcontainers/sandbox.go +++ b/virtcontainers/sandbox.go @@ -1098,13 +1098,6 @@ func (s *Sandbox) generateNetInfo(inf *types.Interface) (NetworkInfo, error) { addrs = append(addrs, *netlinkAddr) } - var ifaceType string - if s.config.NetworkConfig.InterworkingModel == NetXConnectNoneModel { - ifaceType = "tap" - } else { - ifaceType = "veth" - } - return NetworkInfo{ Iface: NetlinkIface{ LinkAttrs: netlink.LinkAttrs{ @@ -1112,7 +1105,7 @@ func (s *Sandbox) generateNetInfo(inf *types.Interface) (NetworkInfo, error) { HardwareAddr: hw, MTU: int(inf.Mtu), }, - Type: ifaceType, + Type: inf.LinkType, }, Addrs: addrs, }, nil