Skip to content

Commit

Permalink
fix: gatewaynode might be null (#1896)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7fae28a)
  • Loading branch information
oilbeater committed Sep 8, 2022
1 parent 08331ba commit c39d51a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/apis/kubeovn/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ type SubnetSpec struct {
Provider string `json:"provider,omitempty"`

GatewayType string `json:"gatewayType,omitempty"`
GatewayNode string `json:"gatewayNode,omitempty"`
GatewayNode string `json:"gatewayNode"`
NatOutgoing bool `json:"natOutgoing"`

ExternalEgressGateway string `json:"externalEgressGateway,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/controller/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func (c *Controller) initDefaultLogicalSwitch() error {
Provider: util.OvnProvider,
CIDRBlock: c.config.DefaultCIDR,
Gateway: c.config.DefaultGateway,
GatewayNode: "",
ExcludeIps: strings.Split(c.config.DefaultExcludeIps, ","),
NatOutgoing: true,
GatewayType: kubeovnv1.GWDistributedType,
Expand Down Expand Up @@ -160,6 +161,7 @@ func (c *Controller) initNodeSwitch() error {
Provider: util.OvnProvider,
CIDRBlock: c.config.NodeSwitchCIDR,
Gateway: c.config.NodeSwitchGateway,
GatewayNode: "",
ExcludeIps: strings.Split(c.config.NodeSwitchGateway, ","),
Protocol: util.CheckProtocol(c.config.NodeSwitchCIDR),
DisableInterConnection: true,
Expand Down

0 comments on commit c39d51a

Please sign in to comment.