Skip to content

Commit

Permalink
Resolve Windows agent crash issue caused by egressSNATRandomFully
Browse files Browse the repository at this point in the history
Signed-off-by: Shuyang Xin <[email protected]>
  • Loading branch information
XinShuYang committed Sep 12, 2024
1 parent afdd261 commit e219dc6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/antrea-agent/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,11 @@ func (o *Options) setK8sNodeDefaultOptions() {
if o.config.Egress.MaxEgressIPsPerNode == 0 {
o.config.Egress.MaxEgressIPsPerNode = defaultMaxEgressIPsPerNode
}
if o.config.Egress.SNATFullyRandomPorts == nil {
o.config.Egress.SNATFullyRandomPorts = ptr.To(o.config.SNATFullyRandomPorts)
}
}

// Regardless of whether the egress feature is enabled, o.config.Egress.SNATFullyRandomPorts should not be nil to prevent a crash in NewClient().
if o.config.Egress.SNATFullyRandomPorts == nil {
o.config.Egress.SNATFullyRandomPorts = ptr.To(o.config.SNATFullyRandomPorts)
}
}

Expand Down

0 comments on commit e219dc6

Please sign in to comment.