@@ -23,6 +23,8 @@ import (
23
23
"github.com/golang/glog"
24
24
)
25
25
26
+ const dockerShimSocket = "unix:///var/run/dockershim.sock"
27
+
26
28
type ProxyConfig struct {
27
29
Mode string
28
30
IPTablesSyncPeriod time.Duration
@@ -76,18 +78,22 @@ func (a *SDNAgent) Run(clientConfig *restclient.Config, stopCh <-chan struct{})
76
78
77
79
informerFactory := kinternalinformers .NewSharedInformerFactory (internalkClient , time .Second * 30 )
78
80
81
+ runtimeEndpoint := dockerShimSocket
82
+
83
+ enableHostports := ! strings .Contains (runtimeEndpoint , "crio" )
84
+
79
85
node , err := sdnnode .New (& sdnnode.OsdnNodeConfig {
80
86
PluginName : a .Options .NetworkConfig .NetworkPluginName ,
81
87
Hostname : hostname ,
82
88
SelfIP : a .Options .NodeIP ,
83
- RuntimeEndpoint : "" ,
89
+ RuntimeEndpoint : runtimeEndpoint ,
84
90
MTU : a .Options .NetworkConfig .MTU ,
85
91
NetworkClient : networkClient ,
86
92
KClient : internalkClient ,
87
93
KubeInformers : informerFactory ,
88
94
IPTablesSyncPeriod : a .Proxy .IPTablesSyncPeriod ,
89
95
ProxyMode : a .getProxyMode (),
90
- EnableHostports : true ,
96
+ EnableHostports : enableHostports ,
91
97
Recorder : recorder ,
92
98
})
93
99
if err != nil {
0 commit comments