Skip to content

Commit

Permalink
Add bandwidth plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Claes Mogren authored and mogren committed Jun 27, 2020
1 parent 6d35fda commit 4ddd248
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ cni-metrics-helper
grpc-health-probe
portmap
loopback
bandwidth
routed-eni-cni-plugin
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ ALLPKGS = $(shell go list ./...)
# BINS is the set of built command executables.
BINS = aws-k8s-agent aws-cni grpc-health-probe cni-metrics-helper
# Plugin binaries
# Not copied: bandwidth bridge dhcp firewall flannel host-device host-local ipvlan macvlan ptp sbr static tuning vlan
# Not copied: bridge dhcp firewall flannel host-device host-local ipvlan macvlan ptp sbr static tuning vlan
# For gnu tar, the full path in the tar file is required
PLUGIN_BINS = ./loopback ./portmap
PLUGIN_BINS = ./loopback ./portmap ./bandwidth

# DOCKER_ARGS is extra arguments passed during container image build.
DOCKER_ARGS =
Expand Down
6 changes: 2 additions & 4 deletions cmd/routed-eni-cni-plugin/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,8 @@ func add(args *skel.CmdArgs, cniTypes typeswrapper.CNITYPES, grpcClient grpcwrap
}

result := &current.Result{
IPs: ips,
Interfaces: []*current.Interface{
&current.Interface{Name: hostVethName},
},
IPs: ips,
Interfaces: []*current.Interface{{Name: hostVethName}},
}

return cniTypes.PrintResult(result, conf.CNIVersion)
Expand Down
1 change: 1 addition & 0 deletions scripts/dockerfiles/Dockerfile.init
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ WORKDIR /init
COPY --from=builder \
/go/src/github.com/aws/amazon-vpc-cni-k8s/loopback \
/go/src/github.com/aws/amazon-vpc-cni-k8s/portmap \
/go/src/github.com/aws/amazon-vpc-cni-k8s/bandwidth \
/go/src/github.com/aws/amazon-vpc-cni-k8s/aws-cni-support.sh \
/go/src/github.com/aws/amazon-vpc-cni-k8s/scripts/init.sh /init/

Expand Down
2 changes: 2 additions & 0 deletions scripts/dockerfiles/Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ WORKDIR /app

COPY --from=builder /go/src/github.com/aws/amazon-vpc-cni-k8s/aws-cni \
/go/src/github.com/aws/amazon-vpc-cni-k8s/misc/10-aws.conflist \
/go/src/github.com/aws/amazon-vpc-cni-k8s/loopback \
/go/src/github.com/aws/amazon-vpc-cni-k8s/portmap \
/go/src/github.com/aws/amazon-vpc-cni-k8s/bandwidth \
/go/src/github.com/aws/amazon-vpc-cni-k8s/aws-cni-support.sh \
/go/src/github.com/aws/amazon-vpc-cni-k8s/aws-k8s-agent \
/go/src/github.com/aws/amazon-vpc-cni-k8s/grpc-health-probe \
Expand Down
2 changes: 1 addition & 1 deletion scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ wait_for_ipam() {
if [[ "$AWS_VPC_K8S_CNI_CONFIGURE_RPFILTER" != "false" ]]; then
# Copy files
echo "Copying CNI plugin binaries ... "
PLUGIN_BINS="portmap aws-cni-support.sh"
PLUGIN_BINS="loopback portmap bandwidth aws-cni-support.sh"
for b in $PLUGIN_BINS; do
# If the file exist, delete it first
if [[ -f "$HOST_CNI_BIN_PATH/$b" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euxo pipefail

PLUGIN_BINS="loopback portmap aws-cni-support.sh"
PLUGIN_BINS="loopback portmap bandwidth aws-cni-support.sh"

for b in $PLUGIN_BINS; do
if [ ! -f "$b" ]; then
Expand Down

0 comments on commit 4ddd248

Please sign in to comment.