Skip to content

Commit e8c4a3d

Browse files
Pavani-Panakantiorsenthil
authored andcommitted
do not ret error on grpc dial
1 parent 2167393 commit e8c4a3d

File tree

1 file changed

+4
-1
lines changed
  • cmd/routed-eni-cni-plugin

1 file changed

+4
-1
lines changed

cmd/routed-eni-cni-plugin/cni.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,13 @@ func add(args *skel.CmdArgs, cniTypes typeswrapper.CNITYPES, grpcClient grpcwrap
279279
result.Interfaces = append(result.Interfaces, dummyInterface)
280280

281281
// Set up a connection to the network policy agent
282+
// Cx might have removed np container if they are not using network policies
283+
// If we are not able to connect to np agent we do not return return error here. If NP agent grpc is not up
284+
// and listening, NP agent will be in crash loop and we will catch the issue there
282285
npConn, err := grpcClient.Dial(npAgentAddress, grpc.WithTransportCredentials(insecure.NewCredentials()))
283286
if err != nil {
284287
log.Errorf("Failed to connect to network policy agent: %v", err)
285-
return errors.Wrap(err, "add cmd: failed to connect to network policy agent backend server")
288+
return cniTypes.PrintResult(result, conf.CNIVersion)
286289
}
287290
defer npConn.Close()
288291

0 commit comments

Comments
 (0)