Skip to content
Browse files

Upgrade client-go (#104)

* Switched to go modules and updated client-go.

* Regenerated the Shipper client using the new code-generator package

* Changed the hack/ script to use the new generator
using go modules

* Added the methods to the workqueue metric provider so that it meets
the new client-go interface requirements.

* ci: remove dep artifacts

Now that we have moved to Go Modules, we no longer need to keep Gopkg
files (dependencies are now managed by go.mod and go.sum), nor do we
need to install and call `dep` in our CI pipeline. Instead, now we just
call `go mod verify`, and ensure that all go commands use the vendored
version of libraries by specifying `-mod=vendor`.

* ci: upgrade golang to 1.12

We can't really use modules in 1.10. Also, we have successfully ran
shipper built with 1.12, so that's the reasonable thing to do.

* ci: skip hack when linting/testing/building shipper

Since hack/tools.go got introduced, trying to build /hack/ fails with:

	hack/tools.go:4:8:error: build constraints exclude all Go files
	in vendor/

We could just add a build tag to make it compile, but there's not much
of a gain there, so let's just skip it completely instead.

* ci: cut down on the amount of stuff we download

1. The kubernetes was only needed because of an older version of Now that it's been upgraded, it's no longer

2. kubectl is not needed since microk8s already installs a version of
that. For convenience, we alias `kubectl` to `microk8s.kubectl`

* Started refactoring the controllers and unit tests to use the new client-go.

* tests: finish refactoring for upgraded client-go

client-go's fake dynamic client no longer contains actions from the
non-dynamic client, so we had to split up, and sometimes join, lists of
actions so they could be checked properly.

With this, now all the unit tests pass with new client-go \o/

* Cleanup dead code and out of date comments
  • Loading branch information...
juliogreff authored and icanhazbroccoli committed Jul 3, 2019
1 parent e09354d commit 1ef3d3c2e12a582796c2d37292a6d0a99de41519
Showing 11,277 changed files with 408,526 additions and 2,504,775 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -1,6 +1,6 @@
language: go
- "1.10"
- "1.12"

sudo: required

@@ -10,20 +10,15 @@ services:
- docker

- RESYNC_PERIOD=30s GOFLAGS=-mod=vendor

- sudo snap install microk8s --classic --channel=1.11/stable
- curl -Lo $GOPATH/bin/kubectl
- curl -Lo $GOPATH/bin/dep
- sudo snap alias microk8s.kubectl kubectl
- curl -L | bash -s -- -b $GOPATH/bin
- chmod +x $GOPATH/bin/*
- echo $PATH && ls -la $GOPATH/bin

install: true

- git clone --depth=1 $GOPATH/src/

- ./ci/ && ./ci/ && ./ci/

0 comments on commit 1ef3d3c

Please sign in to comment.
You can’t perform that action at this time.