From 5d2036324d541b156881888625c6741f3585b121 Mon Sep 17 00:00:00 2001 From: wenqian Date: Fri, 2 Aug 2024 18:29:19 +0800 Subject: [PATCH] fix(cnivpc): return error when add pod network record failed (#41) --- 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 e8bbeab..3ccce19 100644 --- a/cmd/cnivpc/main.go +++ b/cmd/cnivpc/main.go @@ -189,7 +189,8 @@ func cmdAdd(args *skel.CmdArgs) error { err = addPodNetworkRecord(podName, podNS, sandBoxId, netNS, pNet) if err != nil { - log.Warningf("Failed to record pod network info for %s/%s, sandbox: %s", podName, podNS, sandBoxId) + log.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 log.Infof("[Result]: %+v", result)