Skip to content

Commit 19af501

Browse files
committed
RPC changes
1 parent 0f5157a commit 19af501

File tree

5 files changed

+132
-249
lines changed

5 files changed

+132
-249
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ func TestCmdDel(t *testing.T) {
401401
DeviceNumber: devNum,
402402
RouteTableId: devNum + 1,
403403
}}
404-
delNetworkReply := &rpc.DelNetworkReply{Success: true, IPv4Addr: ipAddr, DeviceNumber: devNum, NetworkPolicyMode: "none"}
404+
delNetworkReply := &rpc.DelNetworkReply{Success: true, IPAddress: addrs, NetworkPolicyMode: "none"}
405405

406406
mockC.EXPECT().DelNetwork(gomock.Any(), gomock.Any()).Return(delNetworkReply, nil)
407407

pkg/ipamd/ipamd.go

+1
Original file line numberDiff line numberDiff line change
@@ -2679,6 +2679,7 @@ func (c *IPAMContext) SetAPIServerConnectivity(connected bool) {
26792679
// and we want to keep working with that value
26802680
log.Info("API server connection lost, continuing with current maxPods value")
26812681
}
2682+
}
26822683

26832684
type Decisions struct {
26842685
Stats *datastore.DataStoreStats

pkg/ipamd/rpc_handler.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,10 @@ func (s *server) DelNetwork(ctx context.Context, in *rpc.DelNetworkRequest) (*rp
411411
log.Errorf("Failed to unmarshal PodENIData JSON: %v", err)
412412
}
413413
return &rpc.DelNetworkReply{
414-
Success: true,
415-
PodVlanId: int32(podENIData[0].VlanID),
416-
IPAddress: []*rpc.IPAddress{&rpc.IPAddress{IPv4Addr: podENIData[0].PrivateIP}},
417-
NetworkPolicyMode: s.ipamContext.networkPolicyMode
414+
Success: true,
415+
PodVlanId: int32(podENIData[0].VlanID),
416+
IPAddress: []*rpc.IPAddress{&rpc.IPAddress{IPv4Addr: podENIData[0].PrivateIP}},
417+
NetworkPolicyMode: s.ipamContext.networkPolicyMode,
418418
}, err
419419
}
420420
}
@@ -452,9 +452,9 @@ func (s *server) DelNetwork(ctx context.Context, in *rpc.DelNetworkRequest) (*rp
452452

453453
log.Infof("Send DelNetworkReply: IPAddress: %+v, err: %v", ipAddr, errors)
454454
return &rpc.DelNetworkReply{
455-
Success: errors == nil,
456-
IPAddress: ipAddr,
457-
NetworkPolicyMode: s.ipamContext.networkPolicyMode
455+
Success: errors == nil,
456+
IPAddress: ipAddr,
457+
NetworkPolicyMode: s.ipamContext.networkPolicyMode,
458458
}, errors
459459
}
460460

0 commit comments

Comments
 (0)