Documentation ¶
Index ¶
- func ExecuteCommand(command string) (string, error)
- func SetupNetworkFakeHelper()
- func SetupNetworkHelper()
- func UpdateLinkIPAddrAndLease(nic *rpc.HostNic) error
- type NetworkUtils
- func (n NetworkUtils) CheckAndRepairNetwork(nic *rpc.HostNic) (rpc.Phase, error)
- func (n NetworkUtils) CleanupNetwork(nic *rpc.HostNic) error
- func (n NetworkUtils) CleanupPodNetwork(nic *rpc.HostNic, podIP string) error
- func (n NetworkUtils) IsNSorErr(nspath string) error
- func (n NetworkUtils) LinkByMacAddr(macAddr string) (netlink.Link, error)
- func (n NetworkUtils) SetupNetwork(nic *rpc.HostNic) (rpc.Phase, error)
- func (n NetworkUtils) SetupPodNetwork(nic *rpc.HostNic, ip string) error
- type NetworkUtilsFake
- func (n NetworkUtilsFake) CheckAndRepairNetwork(nic *rpc.HostNic) (rpc.Phase, error)
- func (n NetworkUtilsFake) CleanupNetwork(nic *rpc.HostNic) error
- func (n NetworkUtilsFake) CleanupPodNetwork(nic *rpc.HostNic, ip string) error
- func (n NetworkUtilsFake) IsNSorErr(nspath string) error
- func (n NetworkUtilsFake) LinkByMacAddr(macAddr string) (netlink.Link, error)
- func (n NetworkUtilsFake) SetupNetwork(nic *rpc.HostNic) (rpc.Phase, error)
- func (n NetworkUtilsFake) SetupPodNetwork(nic *rpc.HostNic, ip string) error
- type NetworkUtilsWrap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteCommand ¶
func SetupNetworkFakeHelper ¶
func SetupNetworkFakeHelper()
func SetupNetworkHelper ¶
func SetupNetworkHelper()
func UpdateLinkIPAddrAndLease ¶ added in v1.0.5
Types ¶
type NetworkUtils ¶
type NetworkUtils struct { }
func (NetworkUtils) CheckAndRepairNetwork ¶
func (NetworkUtils) CleanupNetwork ¶
func (n NetworkUtils) CleanupNetwork(nic *rpc.HostNic) error
After the Response is uninstalled, the relevant routes are cleared, so you only need to delete the rule.
func (NetworkUtils) CleanupPodNetwork ¶
func (n NetworkUtils) CleanupPodNetwork(nic *rpc.HostNic, podIP string) error
After the Response is uninstalled, the relevant routes are cleared, so you only need to delete the rule.
func (NetworkUtils) IsNSorErr ¶
func (n NetworkUtils) IsNSorErr(nspath string) error
func (NetworkUtils) LinkByMacAddr ¶
func (n NetworkUtils) LinkByMacAddr(macAddr string) (netlink.Link, error)
should check result, maybe empty
func (NetworkUtils) SetupNetwork ¶
Note: setup NetworkManager to disable dhcp on nic SetupNicNetwork adds default route to route table (nic-<nic_table>)
func (NetworkUtils) SetupPodNetwork ¶
func (n NetworkUtils) SetupPodNetwork(nic *rpc.HostNic, ip string) error
type NetworkUtilsFake ¶
type NetworkUtilsFake struct { Links map[string]netlink.Link Rules map[string]netlink.Rule Routes map[int][]netlink.Route }
func (NetworkUtilsFake) CheckAndRepairNetwork ¶
func (NetworkUtilsFake) CleanupNetwork ¶
func (n NetworkUtilsFake) CleanupNetwork(nic *rpc.HostNic) error
func (NetworkUtilsFake) CleanupPodNetwork ¶
func (n NetworkUtilsFake) CleanupPodNetwork(nic *rpc.HostNic, ip string) error
func (NetworkUtilsFake) IsNSorErr ¶
func (n NetworkUtilsFake) IsNSorErr(nspath string) error
func (NetworkUtilsFake) LinkByMacAddr ¶
func (n NetworkUtilsFake) LinkByMacAddr(macAddr string) (netlink.Link, error)
func (NetworkUtilsFake) SetupNetwork ¶
func (NetworkUtilsFake) SetupPodNetwork ¶
func (n NetworkUtilsFake) SetupPodNetwork(nic *rpc.HostNic, ip string) error
type NetworkUtilsWrap ¶
type NetworkUtilsWrap interface { // for hostnic-node SetupNetwork(nic *rpc.HostNic) (rpc.Phase, error) CleanupNetwork(nic *rpc.HostNic) error CheckAndRepairNetwork(nic *rpc.HostNic) (rpc.Phase, error) // for hostnic-cni SetupPodNetwork(nic *rpc.HostNic, ip string) error CleanupPodNetwork(nic *rpc.HostNic, ip string) error LinkByMacAddr(macAddr string) (netlink.Link, error) IsNSorErr(nspath string) error }
var (
NetworkHelper NetworkUtilsWrap
)
Click to show internal directories.
Click to hide internal directories.