Skip to content

Commit 125962d

Browse files
authored
Merge pull request #558 from jkh52/vendor
Enable vendoring.
2 parents 69f92d8 + 4c4a87e commit 125962d

File tree

3,644 files changed

+1206268
-37
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,644 files changed

+1206268
-37
lines changed

Makefile

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,36 +57,38 @@ mock_gen:
5757

5858
.PHONY: test
5959
test:
60-
go test -race -covermode=atomic -coverprofile=konnectivity.out ./... && go tool cover -html=konnectivity.out -o=konnectivity.html
60+
go test -mod=vendor -race -covermode=atomic -coverprofile=konnectivity.out ./... && go tool cover -html=konnectivity.out -o=konnectivity.html
6161
cd konnectivity-client && go test -race -covermode=atomic -coverprofile=client.out ./... && go tool cover -html=client.out -o=client.html
6262

6363
.PHONY: test-integration
6464
test-integration: build
65-
go test -race ./tests -agent-path $(PWD)/bin/proxy-agent
65+
go test -mod=vendor -race ./tests -agent-path $(PWD)/bin/proxy-agent
6666

6767
## --------------------------------------
6868
## Binaries
6969
## --------------------------------------
7070

71-
SOURCE = $(shell find . -name \*.go)
72-
7371
bin:
7472
mkdir -p bin
7573

7674
.PHONY: build
7775
build: bin/proxy-agent bin/proxy-server bin/proxy-test-client bin/http-test-server
7876

79-
bin/proxy-agent: bin $(SOURCE)
80-
GO111MODULE=on go build -o bin/proxy-agent cmd/agent/main.go
77+
.PHONY: bin/proxy-agent
78+
bin/proxy-agent:
79+
GO111MODULE=on go build -mod=vendor -o bin/proxy-agent cmd/agent/main.go
8180

82-
bin/proxy-test-client: bin $(SOURCE)
83-
GO111MODULE=on go build -o bin/proxy-test-client cmd/test-client/main.go
81+
.PHONY: bin/proxy-test-client
82+
bin/proxy-test-client:
83+
GO111MODULE=on go build -mod=vendor -o bin/proxy-test-client cmd/test-client/main.go
8484

85-
bin/http-test-server: bin $(SOURCE)
86-
GO111MODULE=on go build -o bin/http-test-server cmd/test-server/main.go
85+
.PHONY: bin/http-test-server
86+
bin/http-test-server:
87+
GO111MODULE=on go build -mod=vendor -o bin/http-test-server cmd/test-server/main.go
8788

88-
bin/proxy-server: bin $(SOURCE)
89-
GO111MODULE=on go build -o bin/proxy-server cmd/server/main.go
89+
.PHONY: bin/proxy-server
90+
bin/proxy-server:
91+
GO111MODULE=on go build -mod=vendor -o bin/proxy-server cmd/server/main.go
9092

9193
## --------------------------------------
9294
## Linting

artifacts/images/agent-build.Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,21 @@ WORKDIR /go/src/sigs.k8s.io/apiserver-network-proxy
88
COPY go.mod go.mod
99
COPY go.sum go.sum
1010

11-
# This is required before go mod download because we have a
12-
# replace directive for konnectivity-client in go.mod
13-
# The download will fail without the directory present
11+
# We have a replace directive for konnectivity-client in go.mod
1412
COPY konnectivity-client/ konnectivity-client/
1513

16-
# Cache dependencies
17-
RUN go mod download
14+
# Copy vendored modules
15+
COPY vendor/ vendor/
1816

1917
# Copy the sources
2018
COPY pkg/ pkg/
2119
COPY cmd/ cmd/
2220
COPY proto/ proto/
2321

22+
2423
# Build
2524
ARG ARCH
26-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -v -a -ldflags '-extldflags "-static"' -o proxy-agent sigs.k8s.io/apiserver-network-proxy/cmd/agent
25+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -mod=vendor -v -a -ldflags '-extldflags "-static"' -o proxy-agent sigs.k8s.io/apiserver-network-proxy/cmd/agent
2726

2827
# Copy the loader into a thin image
2928
FROM gcr.io/distroless/static-debian11

artifacts/images/server-build.Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ WORKDIR /go/src/sigs.k8s.io/apiserver-network-proxy
88
COPY go.mod go.mod
99
COPY go.sum go.sum
1010

11-
# This is required before go mod download because we have a
12-
# replace directive for konnectivity-client in go.mod
13-
# The download will fail without the directory present
11+
# We have a replace directive for konnectivity-client in go.mod
1412
COPY konnectivity-client/ konnectivity-client/
1513

16-
# Cache dependencies
17-
RUN go mod download
14+
# Copy vendored modules
15+
COPY vendor/ vendor/
1816

1917
# Copy the sources
2018
COPY pkg/ pkg/
@@ -23,7 +21,7 @@ COPY proto/ proto/
2321

2422
# Build
2523
ARG ARCH
26-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -v -a -ldflags '-extldflags "-static"' -o proxy-server sigs.k8s.io/apiserver-network-proxy/cmd/server
24+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -mod=vendor -v -a -ldflags '-extldflags "-static"' -o proxy-server sigs.k8s.io/apiserver-network-proxy/cmd/server
2725

2826
# Copy the loader into a thin image
2927
FROM gcr.io/distroless/static-debian11

artifacts/images/test-client-build.Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ WORKDIR /go/src/sigs.k8s.io/apiserver-network-proxy
88
COPY go.mod go.mod
99
COPY go.sum go.sum
1010

11-
# This is required before go mod download because we have a
12-
# replace directive for konnectivity-client in go.mod
13-
# The download will fail without the directory present
11+
# We have a replace directive for konnectivity-client in go.mod
1412
COPY konnectivity-client/ konnectivity-client/
1513

16-
# Cache dependencies
17-
RUN go mod download
14+
# Copy vendored modules
15+
COPY vendor/ vendor/
1816

1917
# Copy the sources
2018
COPY pkg/ pkg/
@@ -23,7 +21,7 @@ COPY proto/ proto/
2321

2422
# Build
2523
ARG ARCH
26-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -v -a -ldflags '-extldflags "-static"' -o proxy-test-client sigs.k8s.io/apiserver-network-proxy/cmd/test-client
24+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -mod=vendor -v -a -ldflags '-extldflags "-static"' -o proxy-test-client sigs.k8s.io/apiserver-network-proxy/cmd/test-client
2725

2826
# Copy the loader into a thin image
2927
FROM gcr.io/distroless/static-debian11

artifacts/images/test-server-build.Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,19 @@ WORKDIR /go/src/sigs.k8s.io/apiserver-network-proxy
88
COPY go.mod go.mod
99
COPY go.sum go.sum
1010

11-
12-
# This is required before go mod download because we have a
13-
# replace directive for konnectivity-client in go.mod
14-
# The download will fail without the directory present
11+
# We have a replace directive for konnectivity-client in go.mod
1512
COPY konnectivity-client/ konnectivity-client/
1613

17-
# Cache dependencies
18-
RUN go mod download
14+
# Copy vendored modules
15+
COPY vendor/ vendor/
1916

2017
# Copy the sources
2118
COPY pkg/ pkg/
2219
COPY cmd/ cmd/
2320

2421
# Build
2522
ARG ARCH
26-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -v -a -ldflags '-extldflags "-static"' -o http-test-server sigs.k8s.io/apiserver-network-proxy/cmd/test-server
23+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -mod=vendor -v -a -ldflags '-extldflags "-static"' -o http-test-server sigs.k8s.io/apiserver-network-proxy/cmd/test-server
2724

2825
# Copy the loader into a thin image
2926
FROM gcr.io/distroless/static-debian11

vendor/github.com/beorn7/perks/LICENSE

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)