mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-24 01:24:26 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user