@@ -164,7 +164,9 @@ func main() {
164164 if err != nil {
165165 log .Fatal (logger , "Dialing IPAM" , "error" , err )
166166 }
167- defer conn .Close ()
167+ defer func () {
168+ _ = conn .Close ()
169+ }()
168170
169171 // monitor status of IPAM connection and adjust probe status accordingly
170172 if err := connection .Monitor (signalCtx , health .IPAMCliSvc , conn ); err != nil {
@@ -193,7 +195,9 @@ func main() {
193195 if err != nil {
194196 log .Fatal (logger , "Dialing NSP" , "error" , err )
195197 }
196- defer nspConn .Close ()
198+ defer func () {
199+ _ = nspConn .Close ()
200+ }()
197201
198202 // monitor status of NSP connection and adjust probe status accordingly
199203 if err := connection .Monitor (signalCtx , health .NSPCliSvc , nspConn ); err != nil {
@@ -234,14 +238,18 @@ func main() {
234238 cancelSignalCtx ()
235239 return
236240 }
237- defer cc .Close ()
241+ defer func () {
242+ _ = cc .Close ()
243+ }()
238244 monitorClient := networkservice .NewMonitorConnectionClient (cc )
239245 go nsmmonitor .ConnectionMonitor (ctx , config .Name , monitorClient )
240246
241247 // create and start NSC that connects all remote NSE belonging to the right service
242248 interfaceMonitorClient := interfacemonitor .NewClient (interfaceMonitor , p , netUtils )
243249 nsmClient := service .GetNSC (ctx , & config , nsmAPIClient , p , interfaceMonitorClient , monitorClient )
244- defer nsmClient .Close ()
250+ defer func () {
251+ _ = nsmClient .Close ()
252+ }()
245253 go func () {
246254 service .StartNSC (nsmClient , config .NetworkServiceName )
247255 cancelSignalCtx () // let others with proper clean-up gracefully terminate
0 commit comments