Skip to content

Commit

Permalink
Remove dep on aws-sdk-go
Browse files Browse the repository at this point in the history
Resulting controller binary is ~20% smaller and lib is not used
in current solution
  • Loading branch information
tomflynn committed Feb 27, 2024
1 parent a986152 commit c96680c
Show file tree
Hide file tree
Showing 220 changed files with 4 additions and 279,933 deletions.
23 changes: 0 additions & 23 deletions cmd/controller/main.go
Expand Up @@ -31,7 +31,6 @@ import (
"k8s.io/apimachinery/pkg/util/wait"

"github.com/noironetworks/aci-containers/pkg/controller"
"github.com/noironetworks/aci-containers/pkg/loadbalancer"
)

func main() {
Expand All @@ -42,8 +41,6 @@ func main() {
configPath := flag.String("config-path", "",
"Absolute path to a host agent configuration file")
version := flag.Bool("version", false, "prints github commit ID and build time")
awsSubnets := flag.String("aws-subnets", "", "comma separated list of subnets")
vpcID := flag.String("vpc-id", "", "aws vpc id")
flag.Parse()

if *version {
Expand Down Expand Up @@ -107,26 +104,6 @@ func main() {
versionInfo.BuildTime)
}

if awsSubnets != nil && *awsSubnets != "None" {
nList := strings.Split(*awsSubnets, ",")
awslb, err := loadbalancer.NewAwsLB()
if err != nil {
log.Errorf("NewAwsLB: %v", err)
}

err = awslb.Init(*vpcID, nList)
if err != nil {
log.Errorf("lb init: %v", err)
}

nslb, err := loadbalancer.NewNSLB(awslb)

if err != nil {
log.Errorf("nslb init: %v", err)
}
defer nslb.Stop()
}

if config.EnableMetrics {
_, err = prometheus.New()
if err != nil {
Expand Down
4 changes: 1 addition & 3 deletions docker/Dockerfile-controller
Expand Up @@ -12,6 +12,4 @@ description="This will deploy a single instance of ACI CNI Containers Controller
COPY docker/licenses /licenses
COPY pkg/istiocrd/upstream-istio-cr.yaml /usr/local/var/lib/aci-cni/upstream-istio-ctrlplane-resource.yaml
COPY dist-static/aci-containers-controller /usr/local/bin/
ENV AWS_SUBNETS="None"
ENV AWS_VPCID="None"
ENTRYPOINT exec /usr/local/bin/aci-containers-controller -config-path /usr/local/etc/aci-containers/controller.conf -aws-subnets $AWS_SUBNETS -vpc-id $AWS_VPCID
ENTRYPOINT exec /usr/local/bin/aci-containers-controller -config-path /usr/local/etc/aci-containers/controller.conf
4 changes: 1 addition & 3 deletions docker/Dockerfile-controller-dev
Expand Up @@ -6,6 +6,4 @@ RUN chmod u+x istioctl && mv istioctl /usr/local/bin/istioctl
RUN mkdir -p /usr/local/var/lib/aci-cni
COPY pkg/istiocrd/upstream-istio-cr.yaml /usr/local/var/lib/aci-cni/upstream-istio-ctrlplane-resource.yaml
COPY dist-static/aci-containers-controller /usr/local/bin/
ENV AWS_SUBNETS="None"
ENV AWS_VPCID="None"
ENTRYPOINT exec /usr/local/bin/aci-containers-controller -config-path /usr/local/etc/aci-containers/controller.conf -aws-subnets $AWS_SUBNETS -vpc-id $AWS_VPCID
ENTRYPOINT exec /usr/local/bin/aci-containers-controller -config-path /usr/local/etc/aci-containers/controller.conf
4 changes: 1 addition & 3 deletions docker/dev/alpine/Dockerfile-controller
Expand Up @@ -7,6 +7,4 @@ RUN apk upgrade --no-cache && \
mkdir -p /usr/local/var/lib/aci-cni
COPY pkg/istiocrd/upstream-istio-cr.yaml /usr/local/var/lib/aci-cni/upstream-istio-ctrlplane-resource.yaml
COPY dist-static/aci-containers-controller /usr/local/bin/
ENV AWS_SUBNETS="None"
ENV AWS_VPCID="None"
ENTRYPOINT exec /usr/local/bin/aci-containers-controller -config-path /usr/local/etc/aci-containers/controller.conf -aws-subnets $AWS_SUBNETS -vpc-id $AWS_VPCID
ENTRYPOINT exec /usr/local/bin/aci-containers-controller -config-path /usr/local/etc/aci-containers/controller.conf
4 changes: 1 addition & 3 deletions docker/travis/Dockerfile-controller
Expand Up @@ -17,6 +17,4 @@ RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s
&& mkdir -p /usr/local/var/lib/aci-cni
COPY pkg/istiocrd/upstream-istio-cr.yaml /usr/local/var/lib/aci-cni/upstream-istio-ctrlplane-resource.yaml
COPY dist-static/aci-containers-controller /usr/local/bin/
ENV AWS_SUBNETS="None"
ENV AWS_VPCID="None"
ENTRYPOINT exec /usr/local/bin/aci-containers-controller -config-path /usr/local/etc/aci-containers/controller.conf -aws-subnets $AWS_SUBNETS -vpc-id $AWS_VPCID
ENTRYPOINT exec /usr/local/bin/aci-containers-controller -config-path /usr/local/etc/aci-containers/controller.conf
2 changes: 0 additions & 2 deletions go.mod
Expand Up @@ -3,7 +3,6 @@ go 1.21
require (
github.com/Mellanox/sriovnet v1.0.2
github.com/Shopify/sarama v1.37.2
github.com/aws/aws-sdk-go v1.44.298
github.com/containernetworking/cni v1.1.2
github.com/containernetworking/plugins v1.4.0
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
Expand Down Expand Up @@ -111,7 +110,6 @@ require (
github.com/jcmturner/gofork v1.7.6 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jonboulle/clockwork v0.3.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down
6 changes: 0 additions & 6 deletions go.sum
Expand Up @@ -637,8 +637,6 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/aws/aws-sdk-go v1.44.298 h1:5qTxdubgV7PptZJmp/2qDwD2JL187ePL7VOxsSh1i3g=
github.com/aws/aws-sdk-go v1.44.298/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
Expand Down Expand Up @@ -1003,10 +1001,6 @@ github.com/jcmturner/gokrb5/v8 v8.4.3/go.mod h1:dqRwJGXznQrzw6cWmyo6kH+E7jksEQG/
github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=
github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQymUhg=
github.com/jonboulle/clockwork v0.3.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
Expand Down
263 changes: 0 additions & 263 deletions pkg/loadbalancer/aws.go

This file was deleted.

0 comments on commit c96680c

Please sign in to comment.