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 <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2018-10-29 09:10:17 -07:00
parent 45b219107c
commit 51997775bd

View File

@ -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