mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Make go version requirements clearer
This commit is contained in:
parent
b9aa71089e
commit
0df07424e7
@ -33,15 +33,29 @@ Documentation for other releases can be found at
|
|||||||
|
|
||||||
# Development Guide
|
# Development Guide
|
||||||
|
|
||||||
# Releases and Official Builds
|
This document is intended to be the canonical source of truth for things like
|
||||||
|
supported toolchain versions for building Kubernetes. If you find a
|
||||||
|
requirement that this doc does not capture, please file a bug. If you find
|
||||||
|
other docs with references to requirements that are not simply links to this
|
||||||
|
doc, please file a bug.
|
||||||
|
|
||||||
|
This document is intended to be relative to the branch in which it is found.
|
||||||
|
It is guaranteed that requirements will change over time for the development
|
||||||
|
branch, but release branches of Kubernetes should not change.
|
||||||
|
|
||||||
|
## Releases and Official Builds
|
||||||
|
|
||||||
Official releases are built in Docker containers. Details are [here](http://releases.k8s.io/HEAD/build/README.md). You can do simple builds and development with just a local Docker installation. If want to build go locally outside of docker, please continue below.
|
Official releases are built in Docker containers. Details are [here](http://releases.k8s.io/HEAD/build/README.md). You can do simple builds and development with just a local Docker installation. If want to build go locally outside of docker, please continue below.
|
||||||
|
|
||||||
## Go development environment
|
## Go development environment
|
||||||
|
|
||||||
Kubernetes is written in [Go](http://golang.org) programming language. If you haven't set up Go development environment, please follow [this instruction](http://golang.org/doc/code.html) to install go tool and set up GOPATH. Ensure your version of Go is at least 1.3.
|
Kubernetes is written in the [Go](http://golang.org) programming language. If you haven't set up a Go development environment, please follow [these instructions](http://golang.org/doc/code.html) to install the go tools and set up a GOPATH.
|
||||||
|
|
||||||
## Git Setup
|
### Go versions
|
||||||
|
|
||||||
|
Requires Go version 1.4.x or 1.5.x
|
||||||
|
|
||||||
|
## Git setup
|
||||||
|
|
||||||
Below, we outline one of the more common git workflows that core developers use. Other git workflows are also valid.
|
Below, we outline one of the more common git workflows that core developers use. Other git workflows are also valid.
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ You need an [etcd](https://github.com/coreos/etcd/releases) in your path, please
|
|||||||
|
|
||||||
#### go
|
#### go
|
||||||
|
|
||||||
You need [go](https://golang.org/doc/install) at least 1.3+ in your path, please make sure it is installed and in your ``$PATH``.
|
You need [go](https://golang.org/doc/install) in your path (see [here](../devel/development.md#go-versions) for supported versions), please make sure it is installed and in your ``$PATH``.
|
||||||
|
|
||||||
### Clone the repository
|
### Clone the repository
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ Further information is available in the Kubernetes on Mesos [contrib directory][
|
|||||||
- A running [Mesos cluster on Google Compute Engine][5]
|
- A running [Mesos cluster on Google Compute Engine][5]
|
||||||
- A [VPN connection][10] to the cluster
|
- A [VPN connection][10] to the cluster
|
||||||
- A machine in the cluster which should become the Kubernetes *master node* with:
|
- A machine in the cluster which should become the Kubernetes *master node* with:
|
||||||
- GoLang > 1.2
|
- Go (see [here](../devel/development.md#go-versions) for required versions)
|
||||||
- make (i.e. build-essential)
|
- make (i.e. build-essential)
|
||||||
- Docker
|
- Docker
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ convenient).
|
|||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
1. You need administrator credentials to an ESXi machine or vCenter instance.
|
1. You need administrator credentials to an ESXi machine or vCenter instance.
|
||||||
2. You must have Go (version 1.2 or later) installed: [www.golang.org](http://www.golang.org).
|
2. You must have Go (see [here](../devel/development.md#go-versions) for supported versions) installed: [www.golang.org](http://www.golang.org).
|
||||||
3. You must have your `GOPATH` set up and include `$GOPATH/bin` in your `PATH`.
|
3. You must have your `GOPATH` set up and include `$GOPATH/bin` in your `PATH`.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
@ -240,12 +240,12 @@ EOF
|
|||||||
if [[ "${TRAVIS:-}" != "true" ]]; then
|
if [[ "${TRAVIS:-}" != "true" ]]; then
|
||||||
local go_version
|
local go_version
|
||||||
go_version=($(go version))
|
go_version=($(go version))
|
||||||
if [[ "${go_version[2]}" < "go1.2" ]]; then
|
if [[ "${go_version[2]}" < "go1.4" ]]; then
|
||||||
kube::log::usage_from_stdin <<EOF
|
kube::log::usage_from_stdin <<EOF
|
||||||
|
|
||||||
Detected go version: ${go_version[*]}.
|
Detected go version: ${go_version[*]}.
|
||||||
Kubernetes requires go version 1.2 or greater.
|
Kubernetes requires go version 1.4 or greater.
|
||||||
Please install Go version 1.2 or later.
|
Please install Go version 1.4 or later.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit 2
|
exit 2
|
||||||
|
@ -24,8 +24,8 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
|||||||
|
|
||||||
GO_VERSION=($(go version))
|
GO_VERSION=($(go version))
|
||||||
|
|
||||||
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3|go1.4|go1.5') ]]; then
|
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.4|go1.5') ]]; then
|
||||||
echo "Unknown go version '${GO_VERSION}', skipping gofmt."
|
echo "Unsupported go version '${GO_VERSION}', skipping gofmt."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
|||||||
|
|
||||||
GO_VERSION=($(go version))
|
GO_VERSION=($(go version))
|
||||||
|
|
||||||
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3|go1.4|go1.5') ]]; then
|
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.4|go1.5') ]]; then
|
||||||
echo "Unknown go version '${GO_VERSION}', skipping gofmt."
|
echo "Unsupported go version '${GO_VERSION}', skipping gofmt."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user