Skip to content

Commit

Permalink
delete the process of ip crd delete in cni delete request
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Jul 8, 2021
1 parent 75fbecc commit 0fe6725
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions pkg/daemon/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,5 @@ func (csh cniServerHandler) handleDel(req *restful.Request, resp *restful.Respon
}
}

ipCrName := ovs.PodNameToPortName(podRequest.PodName, podRequest.PodNamespace, podRequest.Provider)
err = csh.KubeOvnClient.KubeovnV1().IPs().Delete(context.Background(), ipCrName, metav1.DeleteOptions{})
if err != nil && !k8serrors.IsNotFound(err) {
errMsg := fmt.Errorf("del ip crd for %s failed %v", ipCrName, err)
klog.Error(errMsg)
if err := resp.WriteHeaderAndEntity(http.StatusInternalServerError, request.CniResponse{Err: errMsg.Error()}); err != nil {
klog.Errorf("failed to write response, %v", err)
}
return
}

resp.WriteHeader(http.StatusNoContent)
}

0 comments on commit 0fe6725

Please sign in to comment.