From 9168284d59797c74971f4e511f5f15412ec54548 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Mon, 7 Sep 2020 17:24:08 +0800 Subject: [PATCH] vpcagent: guard against foul eip records --- pkg/vpcagent/models/modelset.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/vpcagent/models/modelset.go b/pkg/vpcagent/models/modelset.go index f4eccbeeb1..78d49b9974 100644 --- a/pkg/vpcagent/models/modelset.go +++ b/pkg/vpcagent/models/modelset.go @@ -526,6 +526,10 @@ func (set Elasticips) NewModel() db.IModel { func (set Elasticips) AddModel(i db.IModel) { m := i.(*Elasticip) + if m.IpAddr == "" || m.NetworkId == "" { + // eip records can exist with network id and ip addr not set + return + } set[m.Id] = m }