Skip to content

Commit

Permalink
default to memifEnabled true
Browse files Browse the repository at this point in the history
This patch enables memif support by default. Memif support has been
in beta for the last two years and has gone through extended testing.
As this is a major differentiator for the Calico/VPP integration,
3.29.0 release is a good candidate for making it GA.

Please not that pods will still be required to export the relevant
annotation for it to be actually configured by the CNI.

Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
  • Loading branch information
sknat committed Nov 6, 2024
1 parent 91274ed commit fd7e5b3
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,24 +310,12 @@ type CalicoVppFeatureGatesConfigType struct {
}

func (self *CalicoVppFeatureGatesConfigType) Validate() (err error) {
/* disable by default as it might impact security */
if self.MemifEnabled == nil {
self.MemifEnabled = &False
}
if self.VCLEnabled == nil {
self.VCLEnabled = &False
}
if self.MultinetEnabled == nil {
self.MultinetEnabled = &False
}

if self.SRv6Enabled == nil {
self.SRv6Enabled = &False
}
if self.IPSecEnabled == nil {
self.IPSecEnabled = &False
}
return
self.MemifEnabled = DefaultToPtr(self.MemifEnabled, true)
self.VCLEnabled = DefaultToPtr(self.VCLEnabled, false)
self.MultinetEnabled = DefaultToPtr(self.MultinetEnabled, false)
self.SRv6Enabled = DefaultToPtr(self.SRv6Enabled, false)
self.IPSecEnabled = DefaultToPtr(self.IPSecEnabled, false)
return nil
}

func (self *CalicoVppFeatureGatesConfigType) String() string {
Expand Down Expand Up @@ -358,9 +346,7 @@ func (self *CalicoVppIpsecConfigType) GetIpsecNbAsyncCryptoThread() int {
}

func (self *CalicoVppIpsecConfigType) Validate() (err error) {
if self.CrossIpsecTunnels == nil {
self.CrossIpsecTunnels = &False
}
self.CrossIpsecTunnels = DefaultToPtr(self.CrossIpsecTunnels, false)
return
}

Expand Down Expand Up @@ -718,3 +704,10 @@ func PrintAgentConfig(log *logrus.Logger) {
}
PrintEnvVarConfig(log)
}

func DefaultToPtr[T any](ptr *T, defaultV T) *T {
if ptr == nil {
return &defaultV
}
return ptr
}

0 comments on commit fd7e5b3

Please sign in to comment.