Skip to content
Permalink
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/update-codegen.sh 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/k8s.io/code-generator

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
k8s.io/code-generator. Now that it's been upgraded, it's no longer
needed.

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
go:
- "1.10"
- "1.12"

sudo: required

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

env:
- RESYNC_PERIOD=30s
- RESYNC_PERIOD=30s GOFLAGS=-mod=vendor

before_install:
- sudo snap install microk8s --classic --channel=1.11/stable
- curl -Lo $GOPATH/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.11.4/bin/linux/amd64/kubectl
- curl -Lo $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
- sudo snap alias microk8s.kubectl kubectl
- curl -L https://raw.githubusercontent.com/alecthomas/gometalinter/master/scripts/install.sh | bash -s -- -b $GOPATH/bin
- chmod +x $GOPATH/bin/*
- echo $PATH && ls -la $GOPATH/bin

install: true

before_script:
- git clone --depth=1 https://github.com/kubernetes/kubernetes.git $GOPATH/src/k8s.io/kubernetes

script:
- ./ci/test.sh && ./ci/build.sh && ./ci/package.sh

0 comments on commit 1ef3d3c

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