Skip to content

Commit 4c23cce

Browse files
author
Mugesh SP
committed
fix: lint errors
1 parent d1477c8 commit 4c23cce

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

cns/client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,10 +1101,10 @@ func (c *Client) UpdateEndpoint(ctx context.Context, endpointID string, ipInfo m
11011101
return &response, nil
11021102
}
11031103

1104-
func (c *Client) DeleteEndpointState(ctx context.Context, endpointId string) (*cns.Response, error) {
1104+
func (c *Client) DeleteEndpointState(ctx context.Context, endpointID string) (*cns.Response, error) {
11051105
// build the request
11061106
u := c.routes[cns.EndpointAPI]
1107-
uString := u.String() + endpointId
1107+
uString := u.String() + endpointID
11081108
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, uString, http.NoBody)
11091109
if err != nil {
11101110
return nil, errors.Wrap(err, "failed to build request")

cns/restserver/ipam.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ func (service *HTTPRestService) DeleteEndpointStateHandler(w http.ResponseWriter
14041404
if service.EndpointStateStore == nil {
14051405
response := cns.Response{
14061406
ReturnCode: types.UnexpectedError,
1407-
Message: fmt.Sprintf("[DeleteEndpointStateHandler] EndpointStateStore is not initialized"),
1407+
Message: "[DeleteEndpointStateHandler] EndpointStateStore is not initialized",
14081408
}
14091409
err := common.Encode(w, &response)
14101410
logger.Response(opName, response, response.ReturnCode, err)
@@ -1447,7 +1447,7 @@ func (service *HTTPRestService) DeleteEndpointStateHelper(endpointID string) err
14471447
_, endpointExist := service.EndpointState[endpointID]
14481448
if !endpointExist {
14491449
logger.Printf("[deleteEndpointState] endpoint could not be found in the statefile %s", endpointID)
1450-
return fmt.Errorf("[deleteEndpointState] endpoint %s does not exist in the statefile", endpointID)
1450+
return fmt.Errorf("[deleteEndpointState] endpoint %s: %w", endpointID, ErrEndpointStateNotFound)
14511451
}
14521452

14531453
// Delete the endpoint from the state

network/manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,11 +773,11 @@ func (nm *networkManager) DeleteState(epInfos []*EndpointInfo) error {
773773
if nm.IsStatelessCNIMode() {
774774
for _, epInfo := range epInfos {
775775
if epInfo.NICType == cns.NodeNetworkInterfaceFrontendNIC {
776-
response, err := nm.CnsClient.DeleteEndpointState(context.TODO(), epInfo.ContainerID)
776+
response, err := nm.CnsClient.DeleteEndpointState(context.TODO(), epInfo.EndpointID)
777777
if err != nil {
778-
return errors.Wrapf(err, "Delete endpoint API returned with error for endpoint %s", epInfo.ContainerID)
778+
return errors.Wrapf(err, "Delete endpoint API returned with error for endpoint %s", epInfo.EndpointID)
779779
}
780-
logger.Info("Delete endpoint API returned", zap.String("endpointID", epInfo.ContainerID), zap.String("returnCode", response.ReturnCode.String()))
780+
logger.Info("Delete endpoint API returned", zap.String("endpointID", epInfo.EndpointID), zap.String("returnCode", response.ReturnCode.String()))
781781
}
782782
}
783783
return nil

0 commit comments

Comments
 (0)