mirror of
https://github.com/rancher/rke.git
synced 2025-08-15 05:24:32 +00:00
Update to Golang 1.11
This commit is contained in:
parent
1639bcdbd6
commit
22a339ea33
@ -11,7 +11,7 @@ RUN apt-get update && \
|
|||||||
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
|
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
|
||||||
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash
|
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash
|
||||||
|
|
||||||
RUN wget -O - https://storage.googleapis.com/golang/go1.8.3.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
|
RUN wget -O - https://storage.googleapis.com/golang/go1.11.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
|
||||||
go get github.com/rancher/trash && go get golang.org/x/lint/golint
|
go get github.com/rancher/trash && go get golang.org/x/lint/golint
|
||||||
|
|
||||||
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
|
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
|
||||||
|
@ -236,16 +236,16 @@ func (c *Cluster) BuildKubeControllerProcess(prefixPath string) v3.Process {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CommandArgs := map[string]string{
|
CommandArgs := map[string]string{
|
||||||
"address": "0.0.0.0",
|
"address": "0.0.0.0",
|
||||||
"cloud-provider": c.CloudProvider.Name,
|
"cloud-provider": c.CloudProvider.Name,
|
||||||
"allow-untagged-cloud": "true",
|
"allow-untagged-cloud": "true",
|
||||||
"configure-cloud-routes": "false",
|
"configure-cloud-routes": "false",
|
||||||
"leader-elect": "true",
|
"leader-elect": "true",
|
||||||
"kubeconfig": pki.GetConfigPath(pki.KubeControllerCertName),
|
"kubeconfig": pki.GetConfigPath(pki.KubeControllerCertName),
|
||||||
"enable-hostpath-provisioner": "false",
|
"enable-hostpath-provisioner": "false",
|
||||||
"node-monitor-grace-period": "40s",
|
"node-monitor-grace-period": "40s",
|
||||||
"pod-eviction-timeout": "5m0s",
|
"pod-eviction-timeout": "5m0s",
|
||||||
"v": "2",
|
"v": "2",
|
||||||
"allocate-node-cidrs": "true",
|
"allocate-node-cidrs": "true",
|
||||||
"cluster-cidr": c.ClusterCIDR,
|
"cluster-cidr": c.ClusterCIDR,
|
||||||
"service-cluster-ip-range": c.Services.KubeController.ServiceClusterIPRange,
|
"service-cluster-ip-range": c.Services.KubeController.ServiceClusterIPRange,
|
||||||
@ -462,8 +462,8 @@ func (c *Cluster) BuildKubeProxyProcess(host *hosts.Host, prefixPath string) v3.
|
|||||||
}
|
}
|
||||||
|
|
||||||
CommandArgs := map[string]string{
|
CommandArgs := map[string]string{
|
||||||
"cluster-cidr": c.ClusterCIDR,
|
"cluster-cidr": c.ClusterCIDR,
|
||||||
"v": "2",
|
"v": "2",
|
||||||
"healthz-bind-address": "0.0.0.0",
|
"healthz-bind-address": "0.0.0.0",
|
||||||
"hostname-override": host.HostnameOverride,
|
"hostname-override": host.HostnameOverride,
|
||||||
"kubeconfig": pki.GetConfigPath(pki.KubeProxyCertName),
|
"kubeconfig": pki.GetConfigPath(pki.KubeProxyCertName),
|
||||||
@ -507,17 +507,17 @@ func (c *Cluster) BuildKubeProxyProcess(host *hosts.Host, prefixPath string) v3.
|
|||||||
}
|
}
|
||||||
registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.Services.Kubeproxy.Image, c.PrivateRegistriesMap)
|
registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.Services.Kubeproxy.Image, c.PrivateRegistriesMap)
|
||||||
return v3.Process{
|
return v3.Process{
|
||||||
Name: services.KubeproxyContainerName,
|
Name: services.KubeproxyContainerName,
|
||||||
Command: Command,
|
Command: Command,
|
||||||
VolumesFrom: VolumesFrom,
|
VolumesFrom: VolumesFrom,
|
||||||
Binds: getUniqStringList(Binds),
|
Binds: getUniqStringList(Binds),
|
||||||
Env: c.Services.Kubeproxy.ExtraEnv,
|
Env: c.Services.Kubeproxy.ExtraEnv,
|
||||||
NetworkMode: "host",
|
NetworkMode: "host",
|
||||||
RestartPolicy: "always",
|
RestartPolicy: "always",
|
||||||
PidMode: "host",
|
PidMode: "host",
|
||||||
Privileged: true,
|
Privileged: true,
|
||||||
HealthCheck: healthCheck,
|
HealthCheck: healthCheck,
|
||||||
Image: c.Services.Kubeproxy.Image,
|
Image: c.Services.Kubeproxy.Image,
|
||||||
ImageRegistryAuthConfig: registryAuthConfig,
|
ImageRegistryAuthConfig: registryAuthConfig,
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
ContainerNameLabel: services.KubeproxyContainerName,
|
ContainerNameLabel: services.KubeproxyContainerName,
|
||||||
@ -540,12 +540,12 @@ func (c *Cluster) BuildProxyProcess() v3.Process {
|
|||||||
Name: services.NginxProxyContainerName,
|
Name: services.NginxProxyContainerName,
|
||||||
Env: Env,
|
Env: Env,
|
||||||
// we do this to force container update when CP hosts change.
|
// we do this to force container update when CP hosts change.
|
||||||
Args: Env,
|
Args: Env,
|
||||||
Command: []string{"nginx-proxy"},
|
Command: []string{"nginx-proxy"},
|
||||||
NetworkMode: "host",
|
NetworkMode: "host",
|
||||||
RestartPolicy: "always",
|
RestartPolicy: "always",
|
||||||
HealthCheck: v3.HealthCheck{},
|
HealthCheck: v3.HealthCheck{},
|
||||||
Image: c.SystemImages.NginxProxy,
|
Image: c.SystemImages.NginxProxy,
|
||||||
ImageRegistryAuthConfig: registryAuthConfig,
|
ImageRegistryAuthConfig: registryAuthConfig,
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
ContainerNameLabel: services.NginxProxyContainerName,
|
ContainerNameLabel: services.NginxProxyContainerName,
|
||||||
@ -764,7 +764,7 @@ func getTagMajorVersion(tag string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getCloudConfigChecksum(config v3.CloudProvider) string {
|
func getCloudConfigChecksum(config v3.CloudProvider) string {
|
||||||
configByteSum := md5.Sum([]byte(fmt.Sprintf("%s", config)))
|
configByteSum := md5.Sum([]byte(fmt.Sprintf("%v", config)))
|
||||||
return fmt.Sprintf("%x", configByteSum)
|
return fmt.Sprintf("%x", configByteSum)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ func GetContainerLogsStdoutStderr(ctx context.Context, dClient *client.Client, c
|
|||||||
var containerLog string
|
var containerLog string
|
||||||
clogs, logserr := ReadContainerLogs(ctx, dClient, containerName, follow, tail)
|
clogs, logserr := ReadContainerLogs(ctx, dClient, containerName, follow, tail)
|
||||||
if logserr != nil {
|
if logserr != nil {
|
||||||
logrus.Debug("logserr: %v", logserr)
|
logrus.Debugf("logserr: %v", logserr)
|
||||||
return containerLog, fmt.Errorf("Failed to get gather logs from container [%s]: %v", containerName, logserr)
|
return containerLog, fmt.Errorf("Failed to get gather logs from container [%s]: %v", containerName, logserr)
|
||||||
}
|
}
|
||||||
defer clogs.Close()
|
defer clogs.Close()
|
||||||
|
@ -11,7 +11,7 @@ OS_ARCH_ARG[windows]="386 amd64"
|
|||||||
OS_ARCH_ARG[darwin]="amd64"
|
OS_ARCH_ARG[darwin]="amd64"
|
||||||
|
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
[ "$(uname)" != "Darwin" ] && LINKFLAGS="-linkmode external -extldflags -static -s"
|
[ "$(uname)" != "Darwin" ] && LINKFLAGS="-extldflags -static -s"
|
||||||
CGO_ENABLED=0 go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/rke
|
CGO_ENABLED=0 go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/rke
|
||||||
|
|
||||||
if [ -n "$CROSS" ]; then
|
if [ -n "$CROSS" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user