Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions cns/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,25 +669,43 @@ func main() {
}

if !disableTelemetry {
telemetryStopProcessing <- true
stopheartbeat <- true
stopSnapshots <- true
logger.Printf("stopping telemetry service thread")
select {
case telemetryStopProcessing <- true:
default:
}

logger.Printf("stop heartbeat thread")
select {
case stopheartbeat <- true:
default:
}

logger.Printf("stop snapshot thread")
select {
case stopSnapshots <- true:
default:
}
}

logger.Printf("stop cns service")
// Cleanup.
if httpRestService != nil {
httpRestService.Stop()
}

if startCNM {
logger.Printf("stop cnm plugin")
if netPlugin != nil {
netPlugin.Stop()
}

if ipamPlugin != nil {
logger.Printf("stop ipam plugin")
ipamPlugin.Stop()
}
}

logger.Printf("CNS exited")
logger.Close()
}