From 79735df02c21d7d785d41d0dbbc2d7754b4da56c Mon Sep 17 00:00:00 2001 From: Sathya Singh <29132953+sathyasi@users.noreply.github.com> Date: Mon, 10 Feb 2020 17:33:08 -0800 Subject: [PATCH] Fix ACN issue 436 for surfacing CNI errors to kubelet. --- cni/network/network.go | 3 ++- cni/network/plugin/main.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cni/network/network.go b/cni/network/network.go index 0b01dbd7e3..c12b2dd167 100644 --- a/cni/network/network.go +++ b/cni/network/network.go @@ -382,7 +382,8 @@ func (plugin *netPlugin) Add(args *cniSkel.CmdArgs) error { if errConsAdd != nil { log.Printf("handleConsecutiveAdd failed with error %v", errConsAdd) result = resultConsAdd - return errConsAdd + err = errConsAdd + return err } if resultConsAdd != nil { diff --git a/cni/network/plugin/main.go b/cni/network/plugin/main.go index 638f0763d3..f8eed1e7ae 100644 --- a/cni/network/plugin/main.go +++ b/cni/network/plugin/main.go @@ -206,7 +206,7 @@ func main() { } if recover() != nil { - return + os.Exit(1) } }()