jtblin / kube2iam

kube2iam provides different AWS IAM roles for pods running on Kubernetes
BSD 3-Clause "New" or "Revised" License
1.96k stars 318 forks source link

Dependency requires Go 1.17, which kube2iam fails to build with #343

Open agaffney opened 1 year ago

agaffney commented 1 year ago

When building kube2iam with Go 1.14 (for the purpose of creating an ARM docker image), you encounter this error:

# golang.org/x/net/http2
/go/pkg/mod/golang.org/x/net@v0.0.0-20220722155237-a158d28d115b/http2/transport.go:416:45: undefined: os.ErrDeadlineExceeded
note: module requires Go 1.17

When trying to build with Go 1.17, you first encounter a problem with things like go get -v -u golang.org/x/tools/cmd/goimports no longer doing the build/install (due to purposeful deprecations...https://go.dev/doc/go-get-install-deprecation). I hand-waved that problem away, and then I get:

go build -o build/bin/linux/kube2iam -ldflags "-s -X ""github.com/jtblin"/kube2iam"/version.Version=$(git describe --abbrev=0 --tags) -X ""github.com/jtblin"/kube2iam"/version.GitCommit=$(git rev-parse --short HEAD) -X ""github.com/jtblin"/kube2iam"/version.BuildDate=$(date +%Y-%m-%d-%H:%M)" github.com/jtblin/kube2iam/cmd
/code/pkg/mod/golang.org/x/crypto@v0.0.0-20210921155107-089bfa567519/ssh/terminal/terminal.go:14:2: missing go.sum entry for module providing package golang.org/x/term (imported by golang.org/x/crypto/ssh/terminal); to add:
    go get golang.org/x/crypto/ssh/terminal@v0.0.0-20210921155107-089bfa567519
make: *** [Makefile:28: build] Error 1
The command '/bin/sh -c make setup && make build' returned a non-zero code: 2

I tried running go mod tidy before running make to update the go.mod and go.sum, but that didn't seem to help.