Skip to content

Commit

Permalink
Updates go to v1.17
Browse files Browse the repository at this point in the history
This patch does the following
- update go.mod and run `go mod vendor`
- update workflow
- update hack.md
- update the ko build strategy
- update the sample ko build that builds shipwright

Signed-off-by: Shivam Mukhade <[email protected]>
  • Loading branch information
Shivam Mukhade committed Nov 25, 2021
1 parent 99f1262 commit 02fb70c
Show file tree
Hide file tree
Showing 96 changed files with 212 additions and 1,633 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: Check out code
uses: actions/checkout@v2
- name: Build
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: Install Ko
uses: imjasonh/setup-ko@20b7695b536c640edfafdd378d96c760460f29d6
- name: Check out code
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: Check out code
uses: actions/checkout@v2
- name: Install kubectl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x

# Install tools
- uses: imjasonh/setup-ko@20b7695b536c640edfafdd378d96c760460f29d6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fetch-depth: 0 # Fetch all history, needed for release note generation.
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x

# Install tools
- uses: imjasonh/setup-ko@20b7695b536c640edfafdd378d96c760460f29d6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x

- name: Checkout code
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion HACK.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In the near future, the above would be setup by the controller.
make clean && make build
```

* This project uses Golang 1.16+ and controller-gen v0.5.0.
* This project uses Golang 1.17+ and controller-gen v0.5.0.
* The controllers create/watch Tekton objects.

# Testing
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ ifeq (, $(shell which ginkgo))
GINKGO_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$GINKGO_GEN_TMP_DIR ;\
go mod init tmp ;\
go get -u github.com/onsi/ginkgo/ginkgo ;\
go get -u github.com/onsi/gomega/... ;\
go install github.com/onsi/ginkgo/ginkgo@latest ;\
go install github.com/onsi/gomega/... ;\
rm -rf $$GINKGO_GEN_TMP_DIR ;\
}
GINKGO=$(GOBIN)/ginkgo
Expand All @@ -137,7 +137,7 @@ ifeq (, $(shell which gocov))
GOCOV_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$GOCOV_GEN_TMP_DIR ;\
go mod init tmp ;\
go get github.com/axw/gocov/[email protected] ;\
go install github.com/axw/gocov/[email protected] ;\
rm -rf $$GOCOV_GEN_TMP_DIR ;\
}
GOCOV=$(GOBIN)/gocov
Expand Down
92 changes: 89 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
module github.com/shipwright-io/build

go 1.16
go 1.17

require (
github.com/docker/cli v20.10.9+incompatible
github.com/go-git/go-git/v5 v5.4.2
github.com/go-logr/logr v0.4.0
github.com/go-logr/zapr v0.4.0 // indirect
github.com/go-openapi/spec v0.20.3
github.com/google/go-containerregistry v0.6.0
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.16.0
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/client_model v0.2.0
github.com/spf13/pflag v1.0.5
Expand All @@ -28,3 +26,91 @@ require (
sigs.k8s.io/controller-runtime v0.6.1
sigs.k8s.io/yaml v1.3.0
)

require (
cloud.google.com/go v0.83.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.1 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.5 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.0 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.7.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v20.10.7+incompatible // indirect
github.com/docker/docker-credential-helpers v0.6.3 // indirect
github.com/emicklei/go-restful v2.15.0+incompatible // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.5.0 // indirect
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/go-logr/zapr v0.4.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/googleapis/gnostic v0.5.3 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/klauspost/compress v1.13.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/xanzy/ssh-agent v0.3.0 // indirect
go.uber.org/atomic v1.8.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 // indirect
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
golang.org/x/tools v0.1.5 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/gengo v0.0.0-20210203185629-de9496dff47b // indirect
k8s.io/klog/v2 v2.5.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
)
6 changes: 3 additions & 3 deletions hack/install-controller-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0

#
# Installs controller-gen utility via "go get".
# Installs controller-gen utility via "go install".
#

set -eu
Expand All @@ -16,14 +16,14 @@ CONTROLLER_GEN_VERSION="${CONTROLLER_GEN_VERSION:-v0.5.0}"
if [ ! -f "${GOPATH}/bin/controller-gen" ]; then
echo "# Installing controller-gen..."
pushd "$(mktemp -d)" >/dev/null 2>&1
GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/controller-gen@"${CONTROLLER_GEN_VERSION}"
go install sigs.k8s.io/controller-tools/cmd/controller-gen@"${CONTROLLER_GEN_VERSION}"
popd >/dev/null 2>&1
fi

if ! grep -q " $CONTROLLER_GEN_VERSION$" <<<"$("${GOPATH}"/bin/controller-gen --version)"; then
echo "Current controller-gen version $("${GOPATH}"/bin/controller-gen --version | cut -d' ' -f2) does not match desired version $CONTROLLER_GEN_VERSION."
echo "In order to update, run:"
echo " GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION}"
echo " go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION}"
echo
exit 1
fi
Expand Down
6 changes: 3 additions & 3 deletions openshift-ci/Dockerfile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ WORKDIR /tmp
RUN mkdir -p $GOPATH/bin
RUN mkdir -p /tmp/goroot

RUN curl -Lo go1.16.linux-amd64.tar.gz https://dl.google.com/go/go1.16.linux-amd64.tar.gz && tar -C /tmp/goroot -xzf go1.16.linux-amd64.tar.gz
RUN curl -Lo go1.17.linux-amd64.tar.gz https://dl.google.com/go/go1.17.linux-amd64.tar.gz && tar -C /tmp/goroot -xzf go1.17.linux-amd64.tar.gz
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl $GOPATH/bin/

RUN go get -u github.com/onsi/ginkgo/ginkgo # installs the ginkgo CLI
RUN go get -u github.com/onsi/gomega/... # fetches the matcher library
RUN go install github.com/onsi/ginkgo/ginkgo@latest # installs the ginkgo CLI
RUN go install github.com/onsi/gomega/... # fetches the matcher library

RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/

Expand Down
1 change: 1 addition & 0 deletions pkg/apis/build/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion samples/build/build_ko_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
- name: go-flags
value: "-v -mod=vendor -ldflags=-w"
- name: go-version
value: "1.16"
value: "1.17"
- name: package-directory
value: ./cmd/shipwright-build-controller
source:
Expand Down
2 changes: 1 addition & 1 deletion samples/buildstrategy/ko/buildstrategy_ko_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
default: ""
- name: go-version
description: "Version of Go, must match a tag from https://hub.docker.com/_/golang?tab=tags"
default: "1.16"
default: "1.17"
- name: ko-version
description: "Version of ko, must be either 'latest', or a release name from https://github.com/google/ko/releases"
default: latest
Expand Down
12 changes: 0 additions & 12 deletions vendor/github.com/Azure/go-autorest/autorest/adal/go.mod

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/github.com/Azure/go-autorest/autorest/adal/go.sum

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/Azure/go-autorest/autorest/date/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/Azure/go-autorest/autorest/date/go.sum

This file was deleted.

12 changes: 0 additions & 12 deletions vendor/github.com/Azure/go-autorest/autorest/go.mod

This file was deleted.

23 changes: 0 additions & 23 deletions vendor/github.com/Azure/go-autorest/autorest/go.sum

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/Azure/go-autorest/logger/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/Azure/go-autorest/logger/go.sum

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/Azure/go-autorest/tracing/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/Azure/go-autorest/tracing/go.sum

This file was deleted.

9 changes: 0 additions & 9 deletions vendor/github.com/Microsoft/go-winio/go.mod

This file was deleted.

14 changes: 0 additions & 14 deletions vendor/github.com/Microsoft/go-winio/go.sum

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/acomagu/bufpipe/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/acomagu/bufpipe/go.sum

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/cespare/xxhash/v2/go.mod

This file was deleted.

Empty file.
Loading

0 comments on commit 02fb70c

Please sign in to comment.