Skip to content

Commit f6d3884

Browse files
committed
host network shouldn't config smc
Signed-off-by: bingshen.wbs <[email protected]>
1 parent 55fe787 commit f6d3884

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

internal/deviceplugin/pod_config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ func getPodConfig(pod k8sType.NamespacedName) (*podConfig, error) {
8787
config := &podConfig{
8888
Netns: fmt.Sprintf("/proc/%d/ns/net", sandboxInfo.State.Pid),
8989
}
90+
9091
if sandboxInfo.Config == nil || sandboxInfo.Config.Labels == nil {
9192
return config, nil
9293
}
@@ -125,6 +126,11 @@ func getPodConfig(pod k8sType.NamespacedName) (*podConfig, error) {
125126
return nil, fmt.Errorf("failed to parse sandbox info: %v", err)
126127
}
127128
var podConfig podConfig
129+
if sbStatus.Status != nil && sbStatus.Status.Linux != nil && sbStatus.Status.Linux.Namespaces != nil &&
130+
sbStatus.Status.Linux.Namespaces.Options != nil && sbStatus.Status.Linux.Namespaces.Options.Network == runtimeapi.NamespaceMode_NODE {
131+
podConfig.Netns = "/proc/1/ns/net"
132+
return &podConfig, nil
133+
}
128134
netns, ok := lo.Find(sbSpec.RuntimeSpec.Linux.Namespaces, func(item Namespace) bool {
129135
return item.Type == "network"
130136
})

internal/drivers/netdev.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func EnsureNetDevice(link netlink.Link, eri *types.ERI) error {
7777
}
7878
}
7979
if !addrConfig {
80-
driverLog.Error(fmt.Errorf("ip address not found in netlink"), "ip", conf.ipAddr, "link", eri.MAC)
80+
driverLog.Error(fmt.Errorf("ip address not found in netlink, check the terway ENI writelist config: https://help.aliyun.com/zh/ack/ack-managed-and-ack-dedicated/user-guide/configure-a-whitelist-for-an-eni"), "ip address config not expect", "ip", conf.ipAddr, "link", eri.MAC)
8181
}
8282
return nil
8383
}

0 commit comments

Comments
 (0)