aws / amazon-vpc-cni-plugins

VPC CNI plugins for Amazon ECS and EKS.
Apache License 2.0
68 stars 45 forks source link

Update vendor dir with go mod vendor. #62

Closed fierlion closed 2 years ago

fierlion commented 2 years ago

Builds are failing with the following error (fixed by running go mod vendor):

go build \
        -installsuffix cgo \
        -v \
        -a \
        -ldflags " -X github.com/aws/amazon-vpc-cni-plugins/version.Version= -X github.com/aws/amazon-vpc-cni-plugins/version.GitShortHash=unknown -X github.com/aws/amazon-vpc-cni-plugins/version.BuildTime=2022-04-04T23:24:58+0000 -s" \
        -o build/linux_amd64/vpc-shared-eni \
        github.com/aws/amazon-vpc-cni-plugins/plugins/vpc-shared-eni
plugins/vpc-shared-eni/config/kubeapi.go:27:2: cannot find package "k8s.io/apimachinery/pkg/apis/meta/v1" in any of:
        /tmp/tmp.3eIIqfQJeK/src/github.com/aws/amazon-vpc-cni-plugins/vendor/k8s.io/apimachinery/pkg/apis/meta/v1 (vendor tree)
        /usr/local/go/src/k8s.io/apimachinery/pkg/apis/meta/v1 (from $GOROOT)
        /tmp/tmp.3eIIqfQJeK/src/k8s.io/apimachinery/pkg/apis/meta/v1 (from $GOPATH)
plugins/vpc-shared-eni/config/kubeapi.go:28:2: cannot find package "k8s.io/client-go/kubernetes" in any of:
        /tmp/tmp.3eIIqfQJeK/src/github.com/aws/amazon-vpc-cni-plugins/vendor/k8s.io/client-go/kubernetes (vendor tree)
        /usr/local/go/src/k8s.io/client-go/kubernetes (from $GOROOT)
        /tmp/tmp.3eIIqfQJeK/src/k8s.io/client-go/kubernetes (from $GOPATH)
plugins/vpc-shared-eni/config/kubeapi.go:29:2: cannot find package "k8s.io/client-go/tools/clientcmd" in any of:
        /tmp/tmp.3eIIqfQJeK/src/github.com/aws/amazon-vpc-cni-plugins/vendor/k8s.io/client-go/tools/clientcmd (vendor tree)
        /usr/local/go/src/k8s.io/client-go/tools/clientcmd (from $GOROOT)
        /tmp/tmp.3eIIqfQJeK/src/k8s.io/client-go/tools/clientcmd (from $GOPATH)
make[1]: *** [build/linux_amd64/vpc-shared-eni] Error 1

I ran `go mod vendor and generated this diff. After running, I am able to successfully build.

I tested with both GO111MODULE=off make build and GO111MODULE=on make build

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

ofiliz commented 2 years ago

Please see: https://github.com/aws/amazon-vpc-cni-plugins/commit/cc99efdde738dd5e6df595b28a1ff57025833b10

Vpc-shared-eni depends on some Kubernetes client packages because of lack of availability of CNI plugin information in Kubernetes. We want to remove all such dependencies. We don't want to bring more in.