Skip to content

Commit

Permalink
For eip created without spec.V4ip this field (#2912)
Browse files Browse the repository at this point in the history
is always empty
  • Loading branch information
oilbeater committed Jun 7, 2023
1 parent b8523fc commit 91b383b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/vpc_nat_gw_eip.go
Expand Up @@ -404,7 +404,7 @@ func (c *Controller) GetEip(eipName string) (*kubeovnv1.IptablesEIP, error) {
klog.Errorf("failed to get eip %s, %v", eipName, err)
return nil, err
}
if cachedEip.Status.IP == "" || cachedEip.Spec.V4ip == "" {
if cachedEip.Status.IP == "" {
return nil, fmt.Errorf("eip '%s' is not ready, has no v4ip", eipName)
}
eip := cachedEip.DeepCopy()
Expand Down Expand Up @@ -484,7 +484,7 @@ func (c *Controller) acquireEip(name, namespace, nicName string) (string, string
}

func (c *Controller) eipChangeIP(eip *kubeovnv1.IptablesEIP) bool {
if eip.Status.IP == "" || eip.Spec.V4ip == "" {
if eip.Status.IP == "" {
// eip created but not ready
return false
}
Expand Down

0 comments on commit 91b383b

Please sign in to comment.