Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go 1.14 #3775

Merged
merged 2 commits into from
Mar 10, 2020
Merged

Go 1.14 #3775

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
17 changes: 6 additions & 11 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 @@ -80,16 +75,16 @@ install: $(BUILD_DIR)/$(PROJECT)
.PHONY: cross
cross: $(foreach platform, $(SUPPORTED_PLATFORMS), $(BUILD_DIR)/$(PROJECT)-$(platform).sha256)

$(BUILD_DIR)/$(PROJECT)-%-$(GOARCH): $(STATIK_FILES) $(GO_FILES) $(BUILD_DIR)
$(BUILD_DIR)/$(PROJECT)-%-$(GOARCH): $(STATIK_FILES) $(GO_FILES) $(BUILD_DIR) deploy/cross/Dockerfile
docker build \
--build-arg PROJECT=$(REPOPATH) \
--build-arg TARGETS=$*/$(GOARCH) \
--build-arg FLAG_LDFLAGS=$(GO_LDFLAGS_$(*)) \
--build-arg FLAG_TAGS=$(GO_BUILD_TAGS_$(*)) \
--build-arg GOOS=$* \
--build-arg GOARCH=$(GOARCH) \
--build-arg TAGS=$(GO_BUILD_TAGS_$(*)) \
--build-arg LDFLAGS=$(GO_LDFLAGS_$(*)) \
-f deploy/cross/Dockerfile \
-t skaffold/cross \
.
docker run --rm --entrypoint sh skaffold/cross -c "cat /build/skaffold*" > $@
docker run --rm skaffold/cross cat /build/skaffold > $@

%.sha256: %
shasum -a 256 $< > $@
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
30 changes: 16 additions & 14 deletions deploy/cross/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM karalabe/xgo-1.13.4
FROM dockercore/golang-cross:1.13.8 as base

ARG PROJECT
ARG FLAG_LDFLAGS
ARG FLAG_TAGS
ARG TARGETS
# 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

ENV PACK cmd/skaffold
ENV EXT_GOPATH /ext-go
ENV FLAG_LDFLAGS $FLAG_LDFLAGS
ENV TARGETS $TARGETS
ENV FLAG_TAGS $FLAG_TAGS
ENV GO111MODULE off
# Cross compile Skaffold for Linux, Windows and MacOS
ARG GOOS
ARG GOARCH
ARG TAGS
ARG LDFLAGS

WORKDIR /ext-go/src/$PROJECT
COPY . .
RUN /build.sh $PROJECT
WORKDIR /skaffold
COPY . ./
RUN if [ "$GOOS" = "darwin" ]; then export CC=o64-clang CXX=o64-clang++; fi; \
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:d414a205df8d8307c92eff8e577cbf2691e46a34 as builder
FROM gcr.io/k8s-skaffold/build_deps:28bbb2cbb0f23cc7a8af602c0513b3bcd74aa911 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
Loading