Skip to content

Commit

Permalink
fix: invalid memory address (#2585)
Browse files Browse the repository at this point in the history
* fix: invalid memory address

* fix: invalid memory address

---------

Co-authored-by: yl4811 <yl4811@yealink.com>
  • Loading branch information
ShaPoHun and yl4811 committed Mar 31, 2023
1 parent cba9c16 commit 5b7bdcc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/controller/vpc_nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ var (

func (c *Controller) resyncVpcNatConfig() {
cm, err := c.configMapsLister.ConfigMaps(c.config.PodNamespace).Get(util.VpcNatConfig)
if err != nil && !k8serrors.IsNotFound(err) {
if err != nil {
if k8serrors.IsNotFound(err) {
return
}
klog.Errorf("failed to get ovn-vpc-nat-config, %v", err)
return
}
vpcNatImage = cm.Data["image"]
image, exist := cm.Data["image"]
if !exist {
klog.Errorf("failed to get 'image' at ovn-vpc-nat-config")
return
}
vpcNatImage = image
}

0 comments on commit 5b7bdcc

Please sign in to comment.