Skip to content

Commit

Permalink
feat(natgw): rename var
Browse files Browse the repository at this point in the history
Signed-off-by: SkalaNetworks <[email protected]>
  • Loading branch information
SkalaNetworks committed Jul 22, 2024
1 parent f9873c6 commit 23d5273
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/vpc_nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
var (
vpcNatImage = ""
vpcNatGwBgpSpeakerImage = ""
vpcNatApiNadProvider = ""
vpcNatAPINadProvider = ""
)

func (c *Controller) resyncVpcNatConfig() {
Expand All @@ -35,5 +35,5 @@ func (c *Controller) resyncVpcNatConfig() {
vpcNatGwBgpSpeakerImage = cm.Data["bgpSpeakerImage"]

// NetworkAttachmentDefinition for the BGP speaker to call the API server
vpcNatApiNadProvider = cm.Data["apiNadProvider"]
vpcNatAPINadProvider = cm.Data["apiNadProvider"]
}
6 changes: 3 additions & 3 deletions pkg/controller/vpc_nat_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ func setNatGwRoute(annotations map[string]string, subnetGw string) error {

// Check the API NetworkAttachmentDefinition exists, otherwise we won't be able to attach
// the BGP speaker to a network that has access to the K8S apiserver (and won't be able to detect EIPs)
if vpcNatApiNadProvider == "" {
if vpcNatAPINadProvider == "" {
return fmt.Errorf("no NetworkAttachmentDefinition provided to access apiserver, check configmap ovn-vpc-nat-config and field 'apiNadProvider'")
}

Expand All @@ -768,9 +768,9 @@ func setNatGwRoute(annotations map[string]string, subnetGw string) error {
buf, err := json.Marshal(routes)
if err != nil {
return fmt.Errorf("failed to marshal routes %+v: %v", routes, err)
} else {
annotations[fmt.Sprintf(util.RoutesAnnotationTemplate, vpcNatApiNadProvider)] = string(buf)
}

annotations[fmt.Sprintf(util.RoutesAnnotationTemplate, vpcNatAPINadProvider)] = string(buf)
break
}
}
Expand Down

0 comments on commit 23d5273

Please sign in to comment.