Skip to content

Commit

Permalink
Switch to go 1.14
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <david@gageot.net>
  • Loading branch information
dgageot committed Mar 4, 2020
1 parent 35fa2d1 commit 464934b
Show file tree
Hide file tree
Showing 15 changed files with 187 additions and 26 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dist: xenial

language: go
go: "1.13.x"
go: "1.14.x"
go_import_path: /skaffold

git:
Expand Down Expand Up @@ -42,9 +42,6 @@ jobs:
- $HOME/.cache/go-build
- os: windows
name: "Windows unit"
env:
- GO111MODULE=on
- GOFLAGS="-mod=vendor"
script:
- go test -short -timeout 60s ./...
cache:
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This doc explains the development workflow so you can get started
You must install these tools:

1. [`go`](https://golang.org/doc/install): The language skaffold is
built in (version >= go 1.13)
built in (version >= go 1.14)
1. [`git`](https://help.github.com/articles/set-up-git/): For source control
1. [`make`](https://www.gnu.org/software/make/): For building skaffold.
1. [`golangci-lint`](https://github.com/golangci/golangci-lint): You can use the
Expand Down
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ ifeq "$(strip $(VERSION))" ""
override VERSION = $(shell git describe --always --tags --dirty)
endif

# Force using Go Modules and always read the dependencies from
# the `vendor` folder.
export GO111MODULE = on
export GOFLAGS = -mod=vendor

LDFLAGS_linux = -static
LDFLAGS_darwin =
LDFLAGS_windows =
Expand Down Expand Up @@ -84,7 +79,6 @@ $(BUILD_DIR)/$(PROJECT)-%-$(GOARCH): $(STATIK_FILES) $(GO_FILES) $(BUILD_DIR) de
docker build \
--build-arg GOOS=$* \
--build-arg GOARCH=$(GOARCH) \
--build-arg GOFLAGS="$(GOFLAGS)" \
--build-arg TAGS=$(GO_BUILD_TAGS_$(*)) \
--build-arg LDFLAGS=$(GO_LDFLAGS_$(*)) \
-f deploy/cross/Dockerfile \
Expand Down
5 changes: 0 additions & 5 deletions Makefile.diag
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ VERSION_PACKAGE = $(REPOPATH)/pkg/diag/version

TEST_PACKAGES := $(shell go list ./pkg/diag/...)

# Force using Go Modules and always read the dependencies from
# the `vendor` folder.
export GO111MODULE = on
export GOFLAGS = -mod=vendor

$(BUILD_DIR):
mkdir -p $(BUILD_DIR)

Expand Down
9 changes: 7 additions & 2 deletions deploy/cross/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@

FROM dockercore/golang-cross:1.13.8 as base

# The base image is not yet available for go 1.14.
# Let's just replace the Go that's installed with a newer one.
RUN rm -Rf /usr/local/go && mkdir /usr/local/go
RUN curl --fail --show-error --silent --location https://dl.google.com/go/go1.14.linux-amd64.tar.gz \
| tar xz --directory=/usr/local/go --strip-components=1

# Cross compile Skaffold for Linux, Windows and MacOS
ARG GOOS
ARG GOARCH
ARG GOFLAGS
ARG TAGS
ARG LDFLAGS

WORKDIR /skaffold
COPY . ./
RUN if [ "$GOOS" = "darwin" ]; then export CC=o64-clang CXX=o64-clang++; fi; \
GOOS=$GOOS GOARCH=$GOARCH GOFLAGS=$GOFLAGS CGO_ENABLED=1 \
GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=1 \
go build -tags "${TAGS}" -ldflags "${LDFLAGS}" -o /build/skaffold ./cmd/skaffold
2 changes: 1 addition & 1 deletion deploy/skaffold/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# This base image has to be updated manually after running `make build_deps`
FROM gcr.io/k8s-skaffold/build_deps:0c78248757f1753c4c64a791160d5e2fdd35f157 as builder
FROM gcr.io/k8s-skaffold/build_deps:bf8f2f45bdbfe667f70902099a42782092ff5689 as builder
WORKDIR /skaffold
COPY . .

Expand Down
2 changes: 1 addition & 1 deletion deploy/skaffold/Dockerfile.deps
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ RUN apt-get update && apt-get install --no-install-recommends --no-install-sugge
jq \
apt-transport-https && \
rm -rf /var/lib/apt/lists/*
COPY --from=golang:1.13 /usr/local/go /usr/local/go
COPY --from=golang:1.14 /usr/local/go /usr/local/go
ENV PATH /usr/local/go/bin:/root/go/bin:$PATH
2 changes: 1 addition & 1 deletion deploy/webhook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ COPY --from=download-docsy /docsy ./themes/docsy
COPY --from=download-hugo /hugo /usr/local/bin/
COPY --from=download-kubectl /kubectl /usr/local/bin/

FROM golang:1.13 as webhook
FROM golang:1.14 as webhook
WORKDIR /skaffold
COPY . .
RUN go build -mod=vendor -o /webhook webhook/webhook.go
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/GoogleContainerTools/skaffold

go 1.13
go 1.14

replace (
github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.0.1+incompatible
Expand Down
51 changes: 51 additions & 0 deletions go.sum

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions hack/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,5 @@ IF "%DIRTY" == "" SET TREE=clean ELSE SET TREE=dirty
FOR /F "tokens=*" %%a in ('git rev-parse HEAD') do SET COMMIT=%%a
for /f %%a in ('powershell -Command "Get-Date -format yyyy_MM_dd__HH_mm_ss"') do set BUILD_DATE=%%a
set FLAG_LDFLAGS=" -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.version=%VERSION% -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.buildDate='%BUILD_DATE%' -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.gitCommit=%COMMIT% -X github.com/GoogleContainerTools/skaffold/pkg/skaffold/version.gitTreeState=%TREE% -extldflags \"\""
set GO111MODULE=on
set GOFLAGS=-mod=vendor

go build -ldflags %FLAG_LDFLAGS% -o out/skaffold.exe github.com/GoogleContainerTools/skaffold/cmd/skaffold
2 changes: 1 addition & 1 deletion hack/generate-statik.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if ! [ -x "$(command -v ${LICENSES})" ]; then
# from a dependency.
echo "Installing go-licenses"
pushd $(mktemp -d)
go mod init tmp; GOBIN=${BIN} go get -mod='' github.com/google/go-licenses
go mod init tmp; GOBIN=${BIN} go get github.com/google/go-licenses
popd
fi

Expand Down
2 changes: 1 addition & 1 deletion hack/tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module tools

go 1.13
go 1.14

require (
github.com/corneliusweig/release-notes v0.0.0-20191014214505-0be5c7c66752
Expand Down
2 changes: 2 additions & 0 deletions hack/tools/vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# github.com/corneliusweig/release-notes v0.0.0-20191014214505-0be5c7c66752
## explicit
github.com/corneliusweig/release-notes
# github.com/golang/protobuf v1.2.0
github.com/golang/protobuf/proto
Expand All @@ -11,6 +12,7 @@ github.com/inconshreveable/mousetrap
# github.com/konsorten/go-windows-terminal-sequences v1.0.1
github.com/konsorten/go-windows-terminal-sequences
# github.com/rakyll/statik v0.1.6
## explicit
github.com/rakyll/statik
# github.com/sirupsen/logrus v1.4.2
github.com/sirupsen/logrus
Expand Down
Loading

0 comments on commit 464934b

Please sign in to comment.