Skip to content

Commit 8fcbc60

Browse files
authored
Cleanup glide (#1353)
* Cleanup mentions about glide * Don't use glide to ignore vendor directory Since go-1.9, "./..." no longer contains the "vendor" directory. Also, since #1305 migrated dependency management from glide to go mod, there is no need to think about the "vendor" directory. See: https://golang.org/doc/go1.9#vendor-dotdotdot * go mod tidy
1 parent 25036e1 commit 8fcbc60

File tree

7 files changed

+12
-169
lines changed

7 files changed

+12
-169
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ Note: Code-related PR's require one ACK / LGTM from a maintainer or core contrib
2525

2626
### Adding dependencies
2727

28-
If your patch depends on new packages, add that package with [`glide`](https://github.com/Masterminds/glide). Follow the [instructions to add a dependency](https://github.com/kubernetes/kompose/blob/master/docs/development.md#glide-glide-vc-and-dependency-management).
28+
If your patch depends on new packages, make sure that both `go.mod` and `go.sum` are updated properly. Also we recommend you to execute `go mod tidy` before sending a pull request.

Jenkinsfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ goTemplate{
66
githubOrganisation = 'kubernetes'
77
dockerOrganisation = 'fabric8'
88
project = 'kompose'
9-
makeCommand = "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/usr/local/glide:/usr/local/:/go/bin:/home/jenkins/go/bin \
9+
makeCommand = "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/usr/local/:/go/bin:/home/jenkins/go/bin \
1010
&& bash script/test/cmd/fix_detached_head.sh && make test"
1111
}
1212
}

Makefile

+2-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
GITCOMMIT := $(shell git rev-parse --short HEAD)
1818
BUILD_FLAGS := -ldflags="-w -s -X github.com/kubernetes/kompose/pkg/version.GITCOMMIT=$(GITCOMMIT)"
19-
PKGS = $(shell glide novendor)
2019
TEST_IMAGE := kompose/tests:latest
2120

2221
default: bin
@@ -48,13 +47,13 @@ clean:
4847

4948
.PHONY: test-unit
5049
test-unit:
51-
go test -short $(BUILD_FLAGS) -race -cover -v $(PKGS)
50+
go test -short $(BUILD_FLAGS) -race -cover -v ./...
5251

5352
# Run unit tests and collect coverage
5453
.PHONY: test-unit-cover
5554
test-unit-cover:
5655
# First install packages that are dependencies of the test.
57-
go test -short -i -race -cover $(PKGS)
56+
go test -short -i -race -cover ./...
5857
# go test doesn't support colleting coverage across multiple packages,
5958
# generate go test commands using go list and run go test for every package separately
6059
go list -f '"go test -short -race -cover -v -coverprofile={{.Dir}}/.coverprofile {{.ImportPath}}"' github.com/kubernetes/kompose/... | grep -v "vendor" | xargs -L 1 -P4 sh -c
@@ -91,11 +90,6 @@ lint:
9190
gofmt:
9291
./script/check-gofmt.sh
9392

94-
# Checks if there are nested vendor dirs inside Kompose vendor and if vendor was cleaned by glide-vc
95-
.PHONY: check-vendor
96-
check-vendor:
97-
./script/check-vendor.sh
98-
9993
# Run all tests
10094
.PHONY: test
10195
test: bin test-dep validate test-unit-cover install test-cmd

docs/development.md

+4-46
Original file line numberDiff line numberDiff line change
@@ -53,58 +53,16 @@ git push -f origin myfeature
5353
2. Click the "Compare and pull request" button next to your "myfeature" branch.
5454
3. Check out the pull request process for more details
5555

56-
## `glide`, `glide-vc` and dependency management
57-
58-
Kompose uses `glide` to manage dependencies and `glide-vc` to clean vendor directory.
59-
They are not strictly required for building Kompose but they are required when managing dependencies under the `vendor/` directory.
60-
If you want to make changes to dependencies please make sure that `glide` and `glide-vc` are installed and are in your `$PATH`.
61-
62-
### Installing glide
63-
64-
There are many ways to build and host golang binaries. Here is an easy way to get utilities like `glide` and `glide-vc` installed:
65-
66-
Ensure that Mercurial and Git are installed on your system. (some of the dependencies use the mercurial source control system).
67-
Use `apt-get install mercurial git` or `yum install mercurial git` on Linux, or `brew.sh` on OS X, or download them directly.
68-
69-
```console
70-
go get -u github.com/Masterminds/glide
71-
go get github.com/sgotti/glide-vc
72-
```
73-
74-
Check that `glide` and `glide-vc` commands are working.
75-
76-
```console
77-
glide --version
78-
glide-vc -h
79-
```
80-
81-
### Using glide
82-
83-
#### Adding new dependency
84-
1. Update `glide.yml` file.
85-
86-
Add new packages or subpackages to `glide.yml` depending if you added whole new package as dependency or
87-
just new subpackage.
88-
89-
2. Run `glide update --strip-vendor` to get new dependencies.
90-
Then run `glide-vc --only-code --no-tests` to delete all unnecessary files from vendor.
91-
92-
3. Commit updated `glide.yml`, `glide.lock` and `vendor` to git.
93-
94-
95-
#### Updating dependencies
96-
97-
1. Set new package version in `glide.yml` file.
98-
99-
2. Run `glide update --strip-vendor` to update dependencies.
100-
Then run `glide-vc --only-code --no-tests` to delete all unnecessary files from vendor.
56+
## Go Modules and dependency management
10157

58+
Kompose uses [Go Modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.
59+
If you want to make changes to dependencies please make sure that `go.mod` and `go.sum` are updated properly.
10260

10361
##### Updating Kubernetes and OpenShift
10462
Kubernetes version depends on what version is OpenShift using.
10563
OpenShift is using forked Kubernetes to carry some patches.
10664
Currently it is not possible to use different Kubernetes version from version that OpenShift uses.
107-
(for more see comments in `glide.yml`)
65+
(for more see comments in `go.mod`)
10866

10967
### Adding CLI tests
11068

go.mod

+1-7
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,25 @@ replace github.com/containerd/containerd => github.com/containerd/containerd v1.
1717
replace golang.org/x/sys => golang.org/x/sys v0.0.0-20201029080932-201ba4db2418
1818

1919
require (
20-
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
2120
github.com/docker/cli v0.0.0-20190711175710-5b38d82aa076
2221
github.com/docker/go-connections v0.4.0
2322
github.com/docker/libcompose v0.4.0
2423
github.com/fatih/structs v1.1.0
2524
github.com/fsouza/go-dockerclient v1.6.5
2625
github.com/google/go-cmp v0.4.0
2726
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
28-
github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
2927
github.com/imdario/mergo v0.3.10 // indirect
3028
github.com/joho/godotenv v1.3.0
31-
github.com/mattn/goveralls v0.0.7 // indirect
32-
github.com/mitchellh/gox v1.0.1 // indirect
3329
github.com/moby/sys/mount v0.1.1 // indirect
3430
github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2 // indirect
35-
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5 // indirect
3631
github.com/novln/docker-parser v1.0.0
37-
github.com/opencontainers/selinux v1.6.0 // indirect
3832
github.com/openshift/api v0.0.0-20200803131051-87466835fcc0
3933
github.com/pkg/errors v0.9.1
4034
github.com/sirupsen/logrus v1.6.0
4135
github.com/spf13/cast v1.3.1
4236
github.com/spf13/cobra v1.0.0
4337
github.com/spf13/viper v1.7.1
44-
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
38+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
4539
gopkg.in/yaml.v2 v2.3.0
4640
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
4741
gotest.tools/v3 v3.0.3 // indirect

0 commit comments

Comments
 (0)