From 2f55a176457b0aab122f50cb04a180acbe6cef8c Mon Sep 17 00:00:00 2001 From: wenqian Date: Fri, 2 Aug 2024 18:27:05 +0800 Subject: [PATCH] fix(cnivpc): return error when add pod network record failed (#40) * fix(cnivpc): return error when add pod network record failed * chore: update logs * chore: add ip in error log --- cmd/cnivpc/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/cnivpc/main.go b/cmd/cnivpc/main.go index 31ec8c1..e32d68b 100644 --- a/cmd/cnivpc/main.go +++ b/cmd/cnivpc/main.go @@ -174,7 +174,8 @@ func cmdAdd(args *skel.CmdArgs) error { err = addPodNetworkRecord(podName, podNS, sandBoxId, pNet) if err != nil { - ulog.Warnf("Record pod network info for %s/%s, sandbox: %s, error: %v", podName, podNS, sandBoxId, err) + ulog.Errorf("Record pod network info for %s/%s, sandbox: %s, ip: %s, error: %v", podName, podNS, sandBoxId, pNet.VPCIP, err) + return fmt.Errorf("failed to add pod network record: %v", err) } // Fill result routes ulog.Infof("[Result]: %+v", result)