Skip to content

Commit 6ace13d

Browse files
authored
Merge pull request #696 from l1b0k/feat/evet
report event when ip alloc failed
2 parents 7ae80f3 + 6f6e72b commit 6ace13d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: pkg/controller/multi-ip/node/pool.go

+4
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,10 @@ func (n *ReconcileNode) addIP(ctx context.Context, unSucceedPods map[string]*Pod
632632

633633
updateCrCondition(options)
634634

635+
if err != nil {
636+
n.record.Event(node, corev1.EventTypeWarning, "AllocIPFailed", err.Error())
637+
}
638+
635639
// the err is kept
636640
return err
637641
}

Diff for: pkg/eni/crdv2.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func (r *CRDV2) multiIP(ctx context.Context, cni *daemon.CNI, request ResourceRe
224224
if wait.Interrupted(err) {
225225
allocResp.Err = &types.Error{
226226
Code: types.ErrIPNotAllocated,
227-
Msg: fmt.Sprintf("timed out waiting for ip allocated. Use 'kubectl get nodes.network.alibabacloud.com %s' to see more detail", r.nodeName),
227+
Msg: fmt.Sprintf("timed out waiting for ip allocated. Use 'kubectl describe nodes.network.alibabacloud.com %s' to see more detail", r.nodeName),
228228
R: err,
229229
}
230230
} else {

0 commit comments

Comments
 (0)