Skip to content

Commit

Permalink
[CORE-10974] Remove bandwidth plugin chaining (#3784)
Browse files Browse the repository at this point in the history
  • Loading branch information
coutinhop authored Mar 7, 2025
1 parent 22a16b7 commit 4ff8794
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 76 deletions.
18 changes: 14 additions & 4 deletions pkg/controller/migration/cni/cni_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright (c) 2020-2025 Tigera, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cni

import (
Expand Down Expand Up @@ -29,10 +43,6 @@ const cniTemplate = `{
"type": "portmap",
"snat": true,
"capabilities": {"portMappings": true}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
}
]
}`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2020-2024 Tigera, Inc. All rights reserved.

// Copyright (c) 2020-2025 Tigera, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down Expand Up @@ -67,10 +67,6 @@ func calicoDefaultConfig() []runtime.Object {
"type": "portmap",
"snat": true,
"capabilities": {"portMappings": true}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
}
]
}`,
Expand Down
11 changes: 0 additions & 11 deletions pkg/render/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,16 +699,6 @@ func (c *nodeComponent) createCalicoPluginConfig() map[string]interface{} {
return calicoPluginConfig
}

func (c *nodeComponent) createBandwidthPlugin() map[string]interface{} {
// bandwidth plugin
bandwidthPlugin := map[string]interface{}{
"type": "bandwidth",
"capabilities": map[string]bool{"bandwidth": true},
}

return bandwidthPlugin
}

func (c *nodeComponent) createPortmapPlugin() map[string]interface{} {
// Determine portmap configuration to use.
portmapPlugin := map[string]interface{}{
Expand Down Expand Up @@ -749,7 +739,6 @@ func (c *nodeComponent) nodeCNIConfigMap() *corev1.ConfigMap {

plugins := make([]interface{}, 0)
plugins = append(plugins, c.createCalicoPluginConfig())
plugins = append(plugins, c.createBandwidthPlugin())

// optional portmap plugin
if c.cfg.Installation.CalicoNetwork.HostPorts != nil &&
Expand Down
57 changes: 2 additions & 55 deletions pkg/render/node_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-2024 Tigera, Inc. All rights reserved.

// Copyright (c) 2019-2025 Tigera, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down Expand Up @@ -225,10 +225,6 @@ var _ = Describe("Node rendering tests", func() {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
},
{"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
]
}`, enableIPv4, enableIPv6)))
Expand Down Expand Up @@ -490,12 +486,6 @@ var _ = Describe("Node rendering tests", func() {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
}
},
{
"type": "bandwidth",
"capabilities": {
"bandwidth": true
}
},
{
"type": "portmap",
"snat": true,
Expand Down Expand Up @@ -717,10 +707,6 @@ var _ = Describe("Node rendering tests", func() {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
},
{"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
]
}`, enableIPv4, enableIPv6)))
Expand Down Expand Up @@ -1107,10 +1093,6 @@ var _ = Describe("Node rendering tests", func() {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
},
{"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
]
}`, enableIPv4, enableIPv6)))
Expand Down Expand Up @@ -1527,10 +1509,6 @@ var _ = Describe("Node rendering tests", func() {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
},
{"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
]
}`, enableIPv4, enableIPv6)))
Expand Down Expand Up @@ -2542,10 +2520,6 @@ var _ = Describe("Node rendering tests", func() {
"kubernetes": {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
}
]
}`, enableIPv4, enableIPv6)))
Expand Down Expand Up @@ -2646,12 +2620,6 @@ var _ = Describe("Node rendering tests", func() {
"endpoint_status_dir": "/var/run/calico/endpoint-status",
"type": "calico"
},
{
"capabilities": {
"bandwidth": true
},
"type": "bandwidth"
},
{
"capabilities": {
"portMappings": true
Expand Down Expand Up @@ -2715,10 +2683,6 @@ var _ = Describe("Node rendering tests", func() {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
},
{"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
]
}`, enableIPv4, enableIPv6)))
Expand Down Expand Up @@ -2767,10 +2731,6 @@ var _ = Describe("Node rendering tests", func() {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
},
{"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
]
}`, enableIPv4, enableIPv6)))
Expand Down Expand Up @@ -2833,7 +2793,6 @@ var _ = Describe("Node rendering tests", func() {
"policy": { "type": "k8s" },
"kubernetes": { "kubeconfig": "__KUBECONFIG_FILEPATH__" }
},
{"type": "bandwidth", "capabilities": {"bandwidth": true}},
{"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
]
}`, subnetStr)))
Expand Down Expand Up @@ -2890,7 +2849,6 @@ var _ = Describe("Node rendering tests", func() {
"policy": { "type": "k8s" },
"kubernetes": { "kubeconfig": "__KUBECONFIG_FILEPATH__" }
},
{"type": "bandwidth", "capabilities": {"bandwidth": true}},
{"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
]
}`))
Expand Down Expand Up @@ -2941,7 +2899,6 @@ var _ = Describe("Node rendering tests", func() {
"policy": { "type": "k8s" },
"kubernetes": { "kubeconfig": "__KUBECONFIG_FILEPATH__" }
},
{"type": "bandwidth", "capabilities": {"bandwidth": true}},
{"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
]
}`))
Expand Down Expand Up @@ -2992,12 +2949,6 @@ var _ = Describe("Node rendering tests", func() {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
}
},
{
"type": "bandwidth",
"capabilities": {
"bandwidth": true
}
},
{
"type": "portmap",
"snat": true,
Expand Down Expand Up @@ -3134,10 +3085,6 @@ var _ = Describe("Node rendering tests", func() {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
},
{"type": "portmap", "snat": true, "capabilities": {"portMappings": true}}
]
}`))
Expand Down

0 comments on commit 4ff8794

Please sign in to comment.