Merge pull request #8277 from dcantah/netconf-cni-fix
CRI: Don't always close netConfMonitor channel
This commit is contained in:
commit
2f4f015e5e
@ -260,10 +260,17 @@ func (c *criService) Run() error {
|
|||||||
netSyncGroup.Done()
|
netSyncGroup.Done()
|
||||||
}(h)
|
}(h)
|
||||||
}
|
}
|
||||||
go func() {
|
// For platforms that may not support CNI (darwin etc.) there's no
|
||||||
netSyncGroup.Wait()
|
// use in launching this as `Wait` will return immediately. Further
|
||||||
close(cniNetConfMonitorErrCh)
|
// down we select on this channel along with some others to determine
|
||||||
}()
|
// if we should Close() the CRI service, so closing this preemptively
|
||||||
|
// isn't good.
|
||||||
|
if len(c.cniNetConfMonitor) > 0 {
|
||||||
|
go func() {
|
||||||
|
netSyncGroup.Wait()
|
||||||
|
close(cniNetConfMonitorErrCh)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
// Start streaming server.
|
// Start streaming server.
|
||||||
logrus.Info("Start streaming server")
|
logrus.Info("Start streaming server")
|
||||||
|
@ -22,12 +22,14 @@ import (
|
|||||||
"github.com/containerd/go-cni"
|
"github.com/containerd/go-cni"
|
||||||
)
|
)
|
||||||
|
|
||||||
// initPlatform handles linux specific initialization for the CRI service.
|
// initPlatform handles initialization of the CRI service for non-windows
|
||||||
|
// and non-linux platforms.
|
||||||
func (c *criService) initPlatform() error {
|
func (c *criService) initPlatform() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// cniLoadOptions returns cni load options for the linux.
|
// cniLoadOptions returns cni load options for non-windows and non-linux
|
||||||
|
// platforms.
|
||||||
func (c *criService) cniLoadOptions() []cni.Opt {
|
func (c *criService) cniLoadOptions() []cni.Opt {
|
||||||
return []cni.Opt{}
|
return []cni.Opt{}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
// attaches to
|
// attaches to
|
||||||
const windowsNetworkAttachCount = 1
|
const windowsNetworkAttachCount = 1
|
||||||
|
|
||||||
// initPlatform handles linux specific initialization for the CRI service.
|
// initPlatform handles windows specific initialization for the CRI service.
|
||||||
func (c *criService) initPlatform() error {
|
func (c *criService) initPlatform() error {
|
||||||
pluginDirs := map[string]string{
|
pluginDirs := map[string]string{
|
||||||
defaultNetworkPlugin: c.config.NetworkPluginConfDir,
|
defaultNetworkPlugin: c.config.NetworkPluginConfDir,
|
||||||
|
@ -237,10 +237,17 @@ func (c *criService) Run() error {
|
|||||||
netSyncGroup.Done()
|
netSyncGroup.Done()
|
||||||
}(h)
|
}(h)
|
||||||
}
|
}
|
||||||
go func() {
|
// For platforms that may not support CNI (darwin etc.) there's no
|
||||||
netSyncGroup.Wait()
|
// use in launching this as `Wait` will return immediately. Further
|
||||||
close(cniNetConfMonitorErrCh)
|
// down we select on this channel along with some others to determine
|
||||||
}()
|
// if we should Close() the CRI service, so closing this preemptively
|
||||||
|
// isn't good.
|
||||||
|
if len(c.cniNetConfMonitor) > 0 {
|
||||||
|
go func() {
|
||||||
|
netSyncGroup.Wait()
|
||||||
|
close(cniNetConfMonitorErrCh)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
// Start streaming server.
|
// Start streaming server.
|
||||||
logrus.Info("Start streaming server")
|
logrus.Info("Start streaming server")
|
||||||
|
Loading…
Reference in New Issue
Block a user