@@ -164,7 +164,9 @@ func main() {
164
164
if err != nil {
165
165
log .Fatal (logger , "Dialing IPAM" , "error" , err )
166
166
}
167
- defer conn .Close ()
167
+ defer func () {
168
+ _ = conn .Close ()
169
+ }()
168
170
169
171
// monitor status of IPAM connection and adjust probe status accordingly
170
172
if err := connection .Monitor (signalCtx , health .IPAMCliSvc , conn ); err != nil {
@@ -193,7 +195,9 @@ func main() {
193
195
if err != nil {
194
196
log .Fatal (logger , "Dialing NSP" , "error" , err )
195
197
}
196
- defer nspConn .Close ()
198
+ defer func () {
199
+ _ = nspConn .Close ()
200
+ }()
197
201
198
202
// monitor status of NSP connection and adjust probe status accordingly
199
203
if err := connection .Monitor (signalCtx , health .NSPCliSvc , nspConn ); err != nil {
@@ -234,14 +238,18 @@ func main() {
234
238
cancelSignalCtx ()
235
239
return
236
240
}
237
- defer cc .Close ()
241
+ defer func () {
242
+ _ = cc .Close ()
243
+ }()
238
244
monitorClient := networkservice .NewMonitorConnectionClient (cc )
239
245
go nsmmonitor .ConnectionMonitor (ctx , config .Name , monitorClient )
240
246
241
247
// create and start NSC that connects all remote NSE belonging to the right service
242
248
interfaceMonitorClient := interfacemonitor .NewClient (interfaceMonitor , p , netUtils )
243
249
nsmClient := service .GetNSC (ctx , & config , nsmAPIClient , p , interfaceMonitorClient , monitorClient )
244
- defer nsmClient .Close ()
250
+ defer func () {
251
+ _ = nsmClient .Close ()
252
+ }()
245
253
go func () {
246
254
service .StartNSC (nsmClient , config .NetworkServiceName )
247
255
cancelSignalCtx () // let others with proper clean-up gracefully terminate
0 commit comments