From 2ceaa125834960a80312eaf573bfdf63995be3e0 Mon Sep 17 00:00:00 2001 From: hello2mao Date: Thu, 17 Jan 2019 18:46:44 +0800 Subject: [PATCH] [BUG]handle error:create eip success but query failel --- pkg/cloud-provider/load_balancer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cloud-provider/load_balancer.go b/pkg/cloud-provider/load_balancer.go index 8544ca4..df32beb 100644 --- a/pkg/cloud-provider/load_balancer.go +++ b/pkg/cloud-provider/load_balancer.go @@ -685,6 +685,9 @@ func (bc *BCECloud) createEIP(lb *blb.LoadBalancer) (string, error) { if err != nil { return "", err } + if len(eips) == 0 { + return "", fmt.Errorf("createEIP failed: CreateEip success but query failed") + } eipStatus = eips[0].Status } glog.V(4).Infof("Eip status is: %s", eipStatus)