Skip to content

Commit

Permalink
Tidy up deprecated options
Browse files Browse the repository at this point in the history
Following options are removed since they have been deprecated
for a long time.

```
enableIPSecTunnel
nplPortRange
multicastInterfaces
multicluster.enable
legacyCRDMirroring
```

Signed-off-by: Lan Luo <luola@vmware.com>
  • Loading branch information
luolanzone committed Mar 22, 2024
1 parent df82b76 commit 6730aeb
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 53 deletions.
4 changes: 0 additions & 4 deletions cmd/antrea-agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,6 @@ func run(o *Options) error {

_, encapMode := config.GetTrafficEncapModeFromStr(o.config.TrafficEncapMode)
_, encryptionMode := config.GetTrafficEncryptionModeFromStr(o.config.TrafficEncryptionMode)
if o.config.EnableIPSecTunnel {
klog.InfoS("enableIPSecTunnel is deprecated, use trafficEncryptionMode instead.")
encryptionMode = config.TrafficEncryptionModeIPSec
}
_, ipsecAuthenticationMode := config.GetIPsecAuthenticationModeFromStr(o.config.IPsec.AuthenticationMode)

networkConfig := &config.NetworkConfig{
Expand Down
14 changes: 0 additions & 14 deletions cmd/antrea-agent/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,6 @@ func (o *Options) validateMulticastConfig(encryptionMode config.TrafficEncryptio
for _, version := range o.config.Multicast.IGMPQueryVersions {
o.igmpQueryVersions = append(o.igmpQueryVersions, uint8(version))
}
if len(o.config.Multicast.MulticastInterfaces) == 0 && len(o.config.MulticastInterfaces) > 0 {
klog.InfoS("The multicastInterfaces option is deprecated, please use multicast.multicastInterfaces instead")
o.config.Multicast.MulticastInterfaces = o.config.MulticastInterfaces
}
} else if o.config.Multicast.Enable {
klog.InfoS("The multicast.enable config option is set to true, but it will be ignored because the Multicast feature gate is disabled")
}
Expand Down Expand Up @@ -484,13 +480,6 @@ func (o *Options) setK8sNodeDefaultOptions() {
}

if features.DefaultFeatureGate.Enabled(features.Multicluster) {
if o.config.Multicluster.Enable {
// Multicluster.Enable is deprecated but it may be set by an earlier version
// deployment manifest. If it is set to true, pass the value to
// Multicluster.EnableGateway.
o.config.Multicluster.EnableGateway = true
}

if o.config.Multicluster.EnableGateway && o.config.Multicluster.Namespace == "" {
o.config.Multicluster.Namespace = env.GetPodNamespace()
}
Expand Down Expand Up @@ -638,9 +627,6 @@ func (o *Options) validateExternalNodeOptions() error {
if o.config.NodePortLocal.Enable {
unsupported = append(unsupported, "NodePortLocal")
}
if o.config.EnableIPSecTunnel {
unsupported = append(unsupported, "EnableIPSecTunnel")
}
if unsupported != nil {
return fmt.Errorf("unsupported features on Virtual Machine: {%s}", strings.Join(unsupported, ", "))
}
Expand Down
21 changes: 2 additions & 19 deletions cmd/antrea-agent/options_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,6 @@ func TestMulticlusterOptions(t *testing.T) {
featureGate: true,
expectedErr: "",
},
{
name: "Enable",
mcConfig: agentconfig.MulticlusterConfig{
Enable: true,
},
featureGate: true,
expectedErr: "",
},
{
name: "Enable and EnableGateway",
mcConfig: agentconfig.MulticlusterConfig{
Enable: true,
EnableGateway: true,
},
featureGate: true,
expectedErr: "",
},
{
name: "EnableGateway and EnableStretchedNetworkPolicy",
mcConfig: agentconfig.MulticlusterConfig{
Expand Down Expand Up @@ -112,10 +95,10 @@ func TestMulticlusterOptions(t *testing.T) {
o := &Options{config: config, enableAntreaProxy: true}
features.DefaultMutableFeatureGate.SetFromMap(o.config.FeatureGates)
o.setDefaults()
if tt.mcConfig.Enable && tt.featureGate {
if tt.mcConfig.EnableGateway && tt.featureGate {
assert.True(t, o.config.Multicluster.EnableGateway)
}
if !tt.mcConfig.Enable && !tt.mcConfig.EnableGateway {
if !tt.mcConfig.EnableGateway {
assert.False(t, o.config.Multicluster.EnableGateway)
}

Expand Down
4 changes: 0 additions & 4 deletions cmd/antrea-controller/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ func (o *Options) validate(args []string) error {
}
}

if o.config.LegacyCRDMirroring != nil {
klog.InfoS("The legacyCRDMirroring config option is deprecated and will be ignored (no CRD mirroring)")
}

if !features.DefaultFeatureGate.Enabled(features.Multicluster) && o.config.Multicluster.EnableStretchedNetworkPolicy {
klog.InfoS("Multicluster feature gate is disabled. Multicluster.EnableStretchedNetworkPolicy is ignored")
}
Expand Down
1 change: 0 additions & 1 deletion pkg/agent/multicluster/mc_route_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func newMCDefaultRouteController(t *testing.T,
ciImportInformer := mcInformerFactory.Multicluster().V1alpha1().ClusterInfoImports()

multiclusterConfig := agent.MulticlusterConfig{
Enable: true,
EnableGateway: true,
Namespace: "default",
EnableStretchedNetworkPolicy: true,
Expand Down
9 changes: 0 additions & 9 deletions pkg/config/agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ type AgentConfig struct {
// --service-cluster-ip-range. When AntreaProxy is enabled, this parameter is not needed.
// No default value for this field.
ServiceCIDRv6 string `yaml:"serviceCIDRv6,omitempty"`
// Deprecated. Use TrafficEncryptionMode instead.
EnableIPSecTunnel bool `yaml:"enableIPSecTunnel,omitempty"`
// Determines how tunnel traffic is encrypted.
// It has the following options:
// - none (default): Inter-node Pod traffic will not be encrypted.
Expand Down Expand Up @@ -174,10 +172,6 @@ type AgentConfig struct {
// 2. TransportInterfaceCIDRs
// 3. The Node IP
TransportInterfaceCIDRs []string `yaml:"transportInterfaceCIDRs,omitempty"`
// The names of the interfaces on Nodes that are used to forward multicast traffic.
// Defaults to transport interface if not set.
// Deprecated: use Multicast.MulticastInterfaces instead.
MulticastInterfaces []string `yaml:"multicastInterfaces,omitempty"`
// Multicast configuration options.
Multicast MulticastConfig `yaml:"multicast,omitempty"`
// AntreaProxy contains AntreaProxy related configuration options.
Expand Down Expand Up @@ -329,9 +323,6 @@ type IPsecConfig struct {
}

type MulticlusterConfig struct {
// Deprecated and replaced by "enableGateway". Keep the field in MulticlusterConfig to be
// compatible with earlier version (<= v1.10) Antrea deployment manifests.
Enable bool `yaml:"enable,omitempty"`
// Enable Multi-cluster Gateway.
EnableGateway bool `yaml:"enableGateway,omitempty"`
// The Namespace where Antrea Multi-cluster Controller is running.
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/controller/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ type ControllerConfig struct {
// ClientCAFile is the file path of the certificate bundle for all the signers that is recognized for incoming
// client certificates.
ClientCAFile string `yaml:"clientCAFile,omitempty"`
// Legacy CRD mirroring (deprecated).
LegacyCRDMirroring *bool `yaml:"legacyCRDMirroring,omitempty"`
// Provide the address of Kubernetes apiserver, to override any value provided in kubeconfig or InClusterConfig.
// It is typically used when kube-proxy is not deployed (replaced by AntreaProxy) and kube-controller-manager
// does not run NodeIPAMController (replaced by Antrea NodeIPAM).
Expand Down

0 comments on commit 6730aeb

Please sign in to comment.