Skip to content

Commit 6f6e72b

Browse files
committed
report event when ip alloc failed
Signed-off-by: l1b0k <[email protected]>
1 parent 7ae80f3 commit 6f6e72b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pkg/controller/multi-ip/node/pool.go

Lines changed: 4 additions & 0 deletions
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
}

pkg/eni/crdv2.go

Lines changed: 1 addition & 1 deletion
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)