Skip to content

Commit

Permalink
chore: optimize kube-ovn-cni log
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed May 25, 2020
1 parent e967b4c commit 83ad499
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/daemon/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (csh cniServerHandler) handleAdd(req *restful.Request, resp *restful.Respon
var macAddr, ip, ipAddr, cidr, gw, subnet, ingress, egress, vlanID string
var pod *v1.Pod
var err error
for i := 0; i < 10; i++ {
for i := 0; i < 15; i++ {
pod, err = csh.KubeClient.CoreV1().Pods(podRequest.PodNamespace).Get(podRequest.PodName, metav1.GetOptions{})
if err != nil {
errMsg := fmt.Errorf("get pod %s/%s failed %v", podRequest.PodNamespace, podRequest.PodName, err)
Expand Down Expand Up @@ -77,7 +77,7 @@ func (csh cniServerHandler) handleAdd(req *restful.Request, resp *restful.Respon
}

if pod.Annotations[fmt.Sprintf(util.AllocatedAnnotationTemplate, podRequest.Provider)] != "true" {
err := fmt.Errorf("no address allocated to this pod, please see kube-ovn-controller logs to find errors")
err := fmt.Errorf("no address allocated to pod %s/%s, please see kube-ovn-controller logs to find errors", pod.Name, pod.Name)
klog.Error(err)
resp.WriteHeaderAndEntity(http.StatusInternalServerError, request.CniResponse{Err: err.Error()})
return
Expand Down

0 comments on commit 83ad499

Please sign in to comment.