Skip to content

Commit

Permalink
Set default IPsec authentication mode (#3849)
Browse files Browse the repository at this point in the history
* Set default IPsec authentication mode to avoid Agent crash on
Windows caused by config missing.
* Add `IPsecCertAuth` to unsupported feature gate on Windows.

Fixes: #3848

Signed-off-by: Xu Liu <xliu2@vmware.com>
  • Loading branch information
xliuxu authored Jun 1, 2022
1 parent f38274b commit d734950
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/antrea-agent/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (o *Options) validate(args []string) error {
}
ok, ipsecAuthMode := config.GetIPsecAuthenticationModeFromStr(o.config.IPsec.AuthenticationMode)
if !ok {
return fmt.Errorf("IPsec AuthenticationMode %s is unknown", o.config.TrafficEncapMode)
return fmt.Errorf("IPsec AuthenticationMode %s is unknown", o.config.IPsec.AuthenticationMode)
}
if ipsecAuthMode == config.IPsecAuthenticationModeCert && !features.DefaultFeatureGate.Enabled(features.IPsecCertAuth) {
return fmt.Errorf("IPsec AuthenticationMode %s requires feature gate %s to be enabled", o.config.TrafficEncapMode, features.IPsecCertAuth)
Expand Down Expand Up @@ -257,6 +257,9 @@ func (o *Options) setDefaults() {
if o.config.WireGuard.Port == 0 {
o.config.WireGuard.Port = apis.WireGuardListenPort
}
if o.config.IPsec.AuthenticationMode == "" {
o.config.IPsec.AuthenticationMode = config.IPsecAuthenticationModePSK.String()
}

if features.DefaultFeatureGate.Enabled(features.FlowExporter) {
if o.config.FlowCollectorAddr == "" {
Expand Down
1 change: 1 addition & 0 deletions pkg/features/antrea_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ var (
Multicast: {},
SecondaryNetwork: {},
ServiceExternalIP: {},
IPsecCertAuth: {},
}
)

Expand Down

0 comments on commit d734950

Please sign in to comment.