Skip to content

Commit 472b462

Browse files
authored
Merge pull request #263 from mwhittington21/upgrade-dependencies
Upgrade dependencies
2 parents b768dc9 + 15c2f63 commit 472b462

File tree

15 files changed

+350
-421
lines changed

15 files changed

+350
-421
lines changed

.dockerignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
.idea/
2-
build/bin/darwin/
3-
cmd/
4-
iptables/
5-
version/
6-
vendor/
2+
build/bin/darwin
3+
vendor/

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
- docker
77

88
go:
9-
- 1.10.x
9+
- 1.14.x
1010

1111
os:
1212
- linux
@@ -31,4 +31,4 @@ after_success:
3131
make release;
3232
else
3333
echo "Not executing release on non-tag build";
34-
fi
34+
fi

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
FROM alpine:3.9
1+
FROM golang:1.14.0 AS BUILDER
2+
WORKDIR /go/src/github.com/jtblin/kube2iam
3+
ENV ARCH=linux
4+
ENV CGO_ENABLED=0
5+
COPY . ./
6+
RUN make setup && make build
27

8+
FROM alpine:3.11.3
39
RUN apk --no-cache add \
410
ca-certificates \
511
iptables
6-
7-
COPY build/bin/linux/kube2iam /bin/kube2iam
8-
12+
COPY --from=BUILDER /go/src/github.com/jtblin/kube2iam/build/bin/linux/kube2iam /bin/kube2iam
913
ENTRYPOINT ["kube2iam"]

Makefile

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,17 @@ GOBUILD_VERSION_ARGS := -ldflags "-s -X $(VERSION_VAR)=$(REPO_VERSION) -X $(GIT_
1212
DOCKER_REPO ?= jtblin
1313
IMAGE_NAME := $(DOCKER_REPO)/$(BINARY_NAME)
1414
ARCH ?= darwin
15-
METALINTER_CONCURRENCY ?= 4
16-
METALINTER_DEADLINE ?= 180
15+
GOLANGCI_LINT_VERSION ?= v1.23.8
16+
GOLANGCI_LINT_CONCURRENCY ?= 4
17+
GOLANGCI_LINT_DEADLINE ?= 180
1718
# useful for passing --build-arg http_proxy :)
1819
DOCKER_BUILD_FLAGS :=
1920

2021
setup:
21-
go get -v -u github.com/Masterminds/glide
22-
go get -v -u github.com/githubnemo/CompileDaemon
23-
go get -v -u github.com/alecthomas/gometalinter
22+
go get -v -u golang.org/x/tools/cmd/goimports
23+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.23.8
2424
go get -v -u github.com/jstemmer/go-junit-report
2525
go get -v github.com/mattn/goveralls
26-
gometalinter --install --update
27-
glide install --strip-vendor
2826

2927
build: *.go fmt
3028
go build -o build/bin/$(ARCH)/$(BINARY_NAME) $(GOBUILD_VERSION_ARGS) github.com/jtblin/$(BINARY_NAME)/cmd
@@ -33,23 +31,23 @@ build-race: *.go fmt
3331
go build -race -o build/bin/$(ARCH)/$(BINARY_NAME) $(GOBUILD_VERSION_ARGS) github.com/jtblin/$(BINARY_NAME)/cmd
3432

3533
build-all:
36-
go build $$(glide nv)
34+
go build ./...
3735

3836
fmt:
39-
gofmt -w=true -s $$(find . -type f -name '*.go' -not -path "./vendor/*")
40-
goimports -w=true -d $$(find . -type f -name '*.go' -not -path "./vendor/*")
37+
gofmt -w=true -s $$(find . -type f -name '*.go')
38+
goimports -w=true -d $$(find . -type f -name '*.go')
4139

4240
test:
43-
go test $$(glide nv)
41+
go test ./...
4442

4543
test-race:
46-
go test -race $$(glide nv)
44+
go test -race ./...
4745

4846
bench:
49-
go test -bench=. $$(glide nv)
47+
go test -bench=. ./...
5048

5149
bench-race:
52-
go test -race -bench=. $$(glide nv)
50+
go test -race -bench=. ./...
5351

5452
cover:
5553
./cover.sh
@@ -61,29 +59,19 @@ coveralls:
6159
goveralls -coverprofile=coverage.out -service=travis-ci
6260

6361
junit-test: build
64-
go test -v $$(glide nv) | go-junit-report > test-report.xml
62+
go test -v ./... | go-junit-report > test-report.xml
6563

6664
check:
6765
go install ./cmd
68-
69-
gometalinter --concurrency=$(METALINTER_CONCURRENCY) --deadline=$(METALINTER_DEADLINE)s ./... --vendor --linter='errcheck:errcheck:-ignore=net:Close' --cyclo-over=20 \
70-
--linter='vet:go vet --no-recurse -composites=false:PATH:LINE:MESSAGE' --disable=interfacer --dupl-threshold=50
66+
golangci-lint run --enable=gocyclo --concurrency=$(GOLANGCI_LINT_CONCURRENCY) --deadline=$(GOLANGCI_LINT_DEADLINE)s
7167

7268
check-all:
7369
go install ./cmd
74-
gometalinter --concurrency=$(METALINTER_CONCURRENCY) --deadline=600s ./... --vendor --cyclo-over=20 \
75-
--linter='vet:govet --no-recurse:PATH:LINE:MESSAGE' --dupl-threshold=50
76-
--dupl-threshold=50
70+
golangci-lint run --enable=gocyclo --concurrency=$(GOLANGCI_LINT_CONCURRENCY) --deadline=600s
7771

7872
travis-checks: build test-race check bench-race
7973

80-
watch:
81-
CompileDaemon -color=true -build "make test"
82-
83-
cross:
84-
CGO_ENABLED=0 GOOS=linux go build -o build/bin/linux/$(BINARY_NAME) $(GOBUILD_VERSION_ARGS) -a -installsuffix cgo github.com/jtblin/$(BINARY_NAME)/cmd
85-
86-
docker: cross
74+
docker:
8775
docker build -t $(IMAGE_NAME):$(GIT_HASH) . $(DOCKER_BUILD_FLAGS)
8876

8977
docker-dev: docker
@@ -104,7 +92,5 @@ version:
10492

10593
clean:
10694
rm -rf build/bin/*
107-
-docker rm $(docker ps -a -f 'status=exited' -q)
108-
-docker rmi $(docker images -f 'dangling=true' -q)
10995

11096
.PHONY: build version

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -730,15 +730,6 @@ Usage of kube2iam:
730730
* Retrieve the services url: `minikube service kube2iam --url`
731731
* Test your changes e.g. `curl -is $(minikube service kube2iam --url)/healthz`
732732

733-
### Building
734-
* If using newer version of go:
735-
736-
* Disable Go Modules:
737-
```
738-
export GO111MODULE=off
739-
```
740-
* Code should be under `$GOPATH`
741-
742733
# Author
743734

744735
Jerome Touffe-Blin, [@jtblin](https://twitter.com/jtblin), [About me](http://about.me/jtblin)

0 commit comments

Comments
 (0)