Skip to content

Commit 3465042

Browse files
authored
Remove vendor dir in favor of go module cache (#24)
1 parent 96621b5 commit 3465042

File tree

5,833 files changed

+12
-1590755
lines changed

Some content is hidden

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

5,833 files changed

+12
-1590755
lines changed

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The helper script to install and run lint is placed here at the root of project.
7979
To fix any `gofmt` issues, you can simply run `gofmt` with `-w` flag like this
8080

8181
```shell
82-
find . -name "*.go" | grep -v vendor/ | xargs gofmt -l -s -w
82+
find . -name "*.go" | xargs gofmt -l -s -w
8383
```
8484

8585
### Integration tests

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ REGISTRY?=gcr.io/kaniko-project
3030
REPOPATH ?= $(ORG)/$(PROJECT)
3131
VERSION_PACKAGE = $(REPOPATH)/pkg/version
3232

33-
GO_FILES := $(shell find . -type f -name '*.go' -not -path "./vendor/*")
33+
GO_FILES := $(shell find . -type f -name '*.go')
3434
GO_LDFLAGS := '-extldflags "-static"
3535
GO_LDFLAGS += -X $(VERSION_PACKAGE).version=$(VERSION)
3636
GO_LDFLAGS += -w -s # Drop debugging symbols.
@@ -41,10 +41,8 @@ WARMER_PACKAGE = $(REPOPATH)/cmd/warmer
4141
KANIKO_PROJECT = $(REPOPATH)/kaniko
4242
BUILD_ARG ?=
4343

44-
# Force using Go Modules and always read the dependencies from
45-
# the `vendor` folder.
44+
# Force using Go Modules.
4645
export GO111MODULE = on
47-
export GOFLAGS = -mod=vendor
4846

4947

5048
out/executor: $(GO_FILES)

cmd/executor/cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func addKanikoOptionsFlags() {
290290

291291
// addHiddenFlags marks certain flags as hidden from the executor help text
292292
func addHiddenFlags(cmd *cobra.Command) {
293-
// This flag is added in a vendored directory, hide so that it doesn't come up via --help
293+
// This flag is added in a library, hide so that it doesn't come up via --help
294294
pflag.CommandLine.MarkHidden("azure-container-registry-config")
295295
// Hide this flag as we want to encourage people to use the --context flag instead
296296
cmd.PersistentFlags().MarkHidden("bucket")

deploy/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ COPY . .
3636
# To update the version of any tool installed here, run
3737
#
3838
# go get <tool>@<commit-sha-or-tag>
39-
# go mod vendor
39+
# go mod tidy
4040
#
41-
# Then submit a PR with the changes to `go.mod`, `go.sum`, and `vendor`.
41+
# Then submit a PR with the changes to `go.mod` and `go.sum`.
4242

4343
# Get GCR credential helper
4444
RUN go install github.com/GoogleCloudPlatform/docker-credential-gcr/v2

hack/boilerplate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
set -e
1616

1717
# Ignore these paths in the following tests.
18-
ignore="vendor\|out"
18+
ignore="out"
1919
BOILERPLATEDIR=./hack/boilerplate
2020
files=$(python3 ${BOILERPLATEDIR}/boilerplate.py --rootdir . --boilerplate-dir ${BOILERPLATEDIR})
2121

hack/boilerplate/boilerplate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import sys
2424

2525

26-
SKIPPED_DIRS = ["Godeps", "third_party", ".git", "vendor", "examples", "testdata"]
26+
SKIPPED_DIRS = ["Godeps", "third_party", ".git", "examples", "testdata"]
2727
SKIPPED_FILES = ["install_golint.sh"]
2828

2929
parser = argparse.ArgumentParser()

hack/gofmt.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
# limitations under the License.
1616

1717

18-
files=$(find . -name "*.go" | grep -v vendor/ | xargs gofmt -l -s)
18+
files=$(find . -name "*.go" | xargs gofmt -l -s)
1919
if [[ $files ]]; then
2020
echo "Gofmt errors in files:"
2121
echo "$files"
22-
diff=$(find . -name "*.go" | grep -v vendor/ | xargs gofmt -d -s)
22+
diff=$(find . -name "*.go" | xargs gofmt -d -s)
2323
echo "$diff"
2424
exit 1
2525
fi

integration/BUILD

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ go_test(
3131
"//pkg/timing",
3232
"//pkg/util",
3333
"//testutil",
34-
"//vendor/github.com/google/go-containerregistry/pkg/name",
35-
"//vendor/github.com/google/go-containerregistry/pkg/v1/daemon",
36-
"//vendor/github.com/pkg/errors",
3734
],
3835
)
3936

scripts/misc-integration-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# TestRun and TestLayers
1818
set -e
1919

20-
TESTS=$(./scripts/integration-test.sh -list=Test -mod=vendor)
20+
TESTS=$(./scripts/integration-test.sh -list=Test)
2121

2222
TESTS=$(echo $TESTS | tr ' ' '\n' | grep 'Test'| grep -v 'TestRun' | grep -v 'TestLayers' | grep -v 'TestK8s' | grep -v 'TestSnapshotBenchmark')
2323

scripts/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ GREEN='\033[0;32m'
2323
RESET='\033[0m'
2424

2525
echo "Running go tests..."
26-
go test -cover -coverprofile=out/coverage.out -v -timeout 120s `go list ./... | grep -v vendor | grep -v integration` | sed ''/PASS/s//$(printf "${GREEN}PASS${RESET}")/'' | sed ''/FAIL/s//$(printf "${RED}FAIL${RESET}")/''
26+
go test -cover -coverprofile=out/coverage.out -v -timeout 120s `go list ./... | grep -v integration` | sed ''/PASS/s//$(printf "${GREEN}PASS${RESET}")/'' | sed ''/FAIL/s//$(printf "${RED}FAIL${RESET}")/''
2727
GO_TEST_EXIT_CODE=${PIPESTATUS[0]}
2828
if [[ $GO_TEST_EXIT_CODE -ne 0 ]]; then
2929
exit $GO_TEST_EXIT_CODE

0 commit comments

Comments
 (0)