diff --git a/build/build-image/Dockerfile b/build/build-image/Dockerfile index d7cb832380..e37a241de8 100644 --- a/build/build-image/Dockerfile +++ b/build/build-image/Dockerfile @@ -19,7 +19,7 @@ FROM gcr.io/google_containers/kube-cross:KUBE_BUILD_IMAGE_CROSS_TAG RUN touch /kube-build-image # To run as non-root we sometimes need to rebuild go stdlib packages. -RUN chmod -R a+rwx /usr/local/go/pkg ${K8S_EDGE_GOROOT}/pkg +RUN chmod -R a+rwx /usr/local/go/pkg # For running integration tests /var/run/kubernetes is required # and should be writable by user diff --git a/build/build-image/cross/Dockerfile b/build/build-image/cross/Dockerfile index d1497eff1a..811ee9943e 100644 --- a/build/build-image/cross/Dockerfile +++ b/build/build-image/cross/Dockerfile @@ -15,7 +15,7 @@ # This file creates a standard build environment for building cross # platform go binary for the architecture kubernetes cares about. -FROM golang:1.7.5 +FROM golang:1.8.1 ENV GOARM 7 ENV KUBE_DYNAMIC_CROSSPLATFORMS \ @@ -77,12 +77,3 @@ RUN export ETCD_VERSION=v3.0.17; \ && cd /usr/local/src/etcd \ && curl -fsSL https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz | tar -xz \ && ln -s ../src/etcd/etcd-${ETCD_VERSION}-linux-amd64/etcd /usr/local/bin/ - -# TODO: Remove the need for two golang versions; when we use go1.8 for all other builds we can remove this -ENV K8S_GOLANG_EDGE_VERSION=1.8.1 \ - K8S_EDGE_GOROOT=/usr/local/go_k8s_edge -RUN mkdir -p ${K8S_EDGE_GOROOT} \ - && curl -sSL https://golang.org/dl/go${K8S_GOLANG_EDGE_VERSION}.linux-amd64.tar.gz | tar -xz -C ${K8S_EDGE_GOROOT} --strip-components=1 - -# Prebuild the standard library for those platforms that need the edge GOROOT -RUN for platform in linux/arm linux/ppc64le; do GOOS=${platform%/*} GOARCH=${platform##*/} GOROOT=${K8S_EDGE_GOROOT} go install std; done diff --git a/build/build-image/cross/VERSION b/build/build-image/cross/VERSION index 47d2c2b6f2..ddd7b0809a 100644 --- a/build/build-image/cross/VERSION +++ b/build/build-image/cross/VERSION @@ -1 +1 @@ -v1.7.5-3 +v1.8.1-1 diff --git a/cluster/images/etcd-version-monitor/Makefile b/cluster/images/etcd-version-monitor/Makefile index 5578e3d776..1149f4a0ae 100644 --- a/cluster/images/etcd-version-monitor/Makefile +++ b/cluster/images/etcd-version-monitor/Makefile @@ -15,10 +15,10 @@ # Build the etcd-version-monitor image # # Usage: -# [GOLANG_VERSION=1.7.5] [REGISTRY=gcr.io/google-containers] [TAG=test] make (build|push) +# [GOLANG_VERSION=1.8.1] [REGISTRY=gcr.io/google-containers] [TAG=test] make (build|push) # TODO(shyamjvs): Support architectures other than amd64 if needed. ARCH:=amd64 -GOLANG_VERSION?=1.7.5 +GOLANG_VERSION?=1.8.1 REGISTRY?=gcr.io/google-containers TAG?=0.1.0 IMAGE:=$(REGISTRY)/etcd-version-monitor:$(TAG) diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 67cb10e3fa..5b29df8121 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -274,8 +274,6 @@ kube::golang::set_platform_envs() { "linux/arm") export CGO_ENABLED=1 export CC=arm-linux-gnueabihf-gcc - # Use a special edge version of golang since the stable golang version used for everything else doesn't work - export GOROOT=${K8S_EDGE_GOROOT} ;; "linux/arm64") export CGO_ENABLED=1 @@ -284,8 +282,6 @@ kube::golang::set_platform_envs() { "linux/ppc64le") export CGO_ENABLED=1 export CC=powerpc64le-linux-gnu-gcc - # Use a special edge version of golang since the stable golang version used for everything else doesn't work - export GOROOT=${K8S_EDGE_GOROOT} ;; "linux/s390x") export CGO_ENABLED=1 @@ -487,13 +483,7 @@ kube::golang::build_binaries_for_platform() { local -a nonstatics=() local -a tests=() - # Temporary workaround while we have two GOROOT's (which we'll get rid of as soon as we upgrade to go1.8 for amd64 as well) - local GO=go - if [[ "${GOROOT}" == "${K8S_EDGE_GOROOT:-}" ]]; then - GO="${K8S_EDGE_GOROOT}/bin/go" - fi - - V=2 kube::log::info "Env for ${platform}: GOOS=${GOOS-} GOARCH=${GOARCH-} GOROOT=${GOROOT-} CGO_ENABLED=${CGO_ENABLED-} CC=${CC-} GO=${GO}" + V=2 kube::log::info "Env for ${platform}: GOOS=${GOOS-} GOARCH=${GOARCH-} GOROOT=${GOROOT-} CGO_ENABLED=${CGO_ENABLED-} CC=${CC-}" for binary in "${binaries[@]}"; do if [[ "${binary}" =~ ".test"$ ]]; then @@ -513,7 +503,7 @@ kube::golang::build_binaries_for_platform() { kube::log::progress " " for binary in "${statics[@]:+${statics[@]}}"; do local outfile=$(kube::golang::output_filename_for_binary "${binary}" "${platform}") - CGO_ENABLED=0 "${GO}" build -o "${outfile}" \ + CGO_ENABLED=0 go build -o "${outfile}" \ "${goflags[@]:+${goflags[@]}}" \ -gcflags "${gogcflags}" \ -ldflags "${goldflags}" \ @@ -522,7 +512,7 @@ kube::golang::build_binaries_for_platform() { done for binary in "${nonstatics[@]:+${nonstatics[@]}}"; do local outfile=$(kube::golang::output_filename_for_binary "${binary}" "${platform}") - "${GO}" build -o "${outfile}" \ + go build -o "${outfile}" \ "${goflags[@]:+${goflags[@]}}" \ -gcflags "${gogcflags}" \ -ldflags "${goldflags}" \ @@ -533,13 +523,13 @@ kube::golang::build_binaries_for_platform() { else # Use go install. if [[ "${#nonstatics[@]}" != 0 ]]; then - "${GO}" install "${goflags[@]:+${goflags[@]}}" \ + go install "${goflags[@]:+${goflags[@]}}" \ -gcflags "${gogcflags}" \ -ldflags "${goldflags}" \ "${nonstatics[@]:+${nonstatics[@]}}" fi if [[ "${#statics[@]}" != 0 ]]; then - CGO_ENABLED=0 "${GO}" install -installsuffix cgo "${goflags[@]:+${goflags[@]}}" \ + CGO_ENABLED=0 go install -installsuffix cgo "${goflags[@]:+${goflags[@]}}" \ -gcflags "${gogcflags}" \ -ldflags "${goldflags}" \ "${statics[@]:+${statics[@]}}" @@ -572,13 +562,13 @@ kube::golang::build_binaries_for_platform() { # doing a staleness check on k8s.io/kubernetes/test/e2e package always # returns true (always stale). And that's why we need to install the # test package. - "${GO}" install "${goflags[@]:+${goflags[@]}}" \ + go install "${goflags[@]:+${goflags[@]}}" \ -gcflags "${gogcflags}" \ -ldflags "${goldflags}" \ "${testpkg}" mkdir -p "$(dirname ${outfile})" - "${GO}" test -i -c \ + go test -i -c \ "${goflags[@]:+${goflags[@]}}" \ -gcflags "${gogcflags}" \ -ldflags "${goldflags}" \ diff --git a/test/images/serve_hostname/Makefile b/test/images/serve_hostname/Makefile index e69d442cce..9cb104ec73 100644 --- a/test/images/serve_hostname/Makefile +++ b/test/images/serve_hostname/Makefile @@ -15,11 +15,11 @@ # Cross-build the serve_hostname image # # Usage: -# [TAG=v1.6] [PREFIX=gcr.io/google_containers] [TEST_REGISTRY=gcr.io/k8s-authenticated-test] [ARCH=amd64] [BASEIMAGE=busybox] make all +# [TAG=v1.7] [PREFIX=gcr.io/google_containers] [TEST_REGISTRY=gcr.io/k8s-authenticated-test] [ARCH=amd64] [BASEIMAGE=busybox] make all .PHONY: all push container clean -TAG ?= v1.6 +TAG ?= v1.7 REGISTRY ?= gcr.io/google-containers TEST_REGISTRY ?= gcr.io/k8s-authenticated-test @@ -31,7 +31,7 @@ ALL_ARCH = amd64 arm arm64 ppc64le s390x GOARM=7 TEMP_DIR := $(shell mktemp -d) -GOLANG_VERSION=1.7.5 +GOLANG_VERSION=1.8.1 BIN = serve_hostname SRCS = serve_hostname.go