mirror of
https://github.com/rancher/os.git
synced 2025-08-17 14:28:16 +00:00
Upgrade golang compiler to latest; go fmt files.
This commit is contained in:
parent
6cde287f87
commit
af08844a9a
@ -111,7 +111,7 @@ ENV BUILD_DOCKER_URL=BUILD_DOCKER_URL_${ARCH} \
|
|||||||
DISTRIB_ID=${DISTRIB_ID} \
|
DISTRIB_ID=${DISTRIB_ID} \
|
||||||
DOWNLOADS=/usr/src/downloads \
|
DOWNLOADS=/usr/src/downloads \
|
||||||
GOPATH=/go \
|
GOPATH=/go \
|
||||||
GO_VERSION=1.8.5 \
|
GO_VERSION=1.15.8 \
|
||||||
GOARCH=$ARCH \
|
GOARCH=$ARCH \
|
||||||
HOSTNAME_DEFAULT=${HOSTNAME_DEFAULT} \
|
HOSTNAME_DEFAULT=${HOSTNAME_DEFAULT} \
|
||||||
IMAGE_NAME=${IMAGE_NAME} \
|
IMAGE_NAME=${IMAGE_NAME} \
|
||||||
@ -142,6 +142,7 @@ ENV BUILD_DOCKER_URL=BUILD_DOCKER_URL_${ARCH} \
|
|||||||
PROXMOXVE_SERVICE=${PROXMOXVE_SERVICE} \
|
PROXMOXVE_SERVICE=${PROXMOXVE_SERVICE} \
|
||||||
SKIP_BUILD=${SKIP_BUILD}
|
SKIP_BUILD=${SKIP_BUILD}
|
||||||
ENV PATH=${GOPATH}/bin:/usr/local/go/bin:$PATH
|
ENV PATH=${GOPATH}/bin:/usr/local/go/bin:$PATH
|
||||||
|
ENV GO111MODULE=off
|
||||||
|
|
||||||
RUN mkdir -p ${DOWNLOADS}
|
RUN mkdir -p ${DOWNLOADS}
|
||||||
|
|
||||||
@ -156,11 +157,11 @@ RUN echo "... Downloading ${!KERNEL_URL}"; \
|
|||||||
RUN curl -pfL ${SELINUX_POLICY_URL} > ${DOWNLOADS}/$(basename ${SELINUX_POLICY_URL})
|
RUN curl -pfL ${SELINUX_POLICY_URL} > ${DOWNLOADS}/$(basename ${SELINUX_POLICY_URL})
|
||||||
|
|
||||||
# Install Go
|
# Install Go
|
||||||
RUN wget -O - https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz | tar -xzf - -C /usr/local && \
|
RUN curl -L https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz | tar -xzf - -C /usr/local && \
|
||||||
go get github.com/burmilla/trash
|
go get github.com/burmilla/trash
|
||||||
|
|
||||||
RUN mkdir -p ${GOPATH}/src/golang.org/x && cd ${GOPATH}/src/golang.org/x/ && git clone https://github.com/golang/tools && \
|
# Install golint
|
||||||
cd tools && git checkout 6adeb8aab2ded9eb693b831d5fd090c10a6ebdfa -b temp && go get golang.org/x/lint/golint
|
RUN go get golang.org/x/lint/golint
|
||||||
|
|
||||||
# Install Host Docker
|
# Install Host Docker
|
||||||
RUN curl -fL ${!BUILD_DOCKER_URL} > /usr/bin/docker && \
|
RUN curl -fL ${!BUILD_DOCKER_URL} > /usr/bin/docker && \
|
||||||
|
@ -70,13 +70,13 @@ func TestFetchMetadata(t *testing.T) {
|
|||||||
RootDisk: "/dev/xvda",
|
RootDisk: "/dev/xvda",
|
||||||
NetworkConfig: netconf.NetworkConfig{
|
NetworkConfig: netconf.NetworkConfig{
|
||||||
Interfaces: map[string]netconf.InterfaceConfig{
|
Interfaces: map[string]netconf.InterfaceConfig{
|
||||||
/* "eth0": netconf.InterfaceConfig{
|
/* "eth0": netconf.InterfaceConfig{
|
||||||
Addresses: []string{
|
Addresses: []string{
|
||||||
"1.2.3.4",
|
"1.2.3.4",
|
||||||
"5.6.7.8",
|
"5.6.7.8",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
*/},
|
||||||
*/},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -100,13 +100,13 @@ func TestFetchMetadata(t *testing.T) {
|
|||||||
RootDisk: "/dev/nvme0n1",
|
RootDisk: "/dev/nvme0n1",
|
||||||
NetworkConfig: netconf.NetworkConfig{
|
NetworkConfig: netconf.NetworkConfig{
|
||||||
Interfaces: map[string]netconf.InterfaceConfig{
|
Interfaces: map[string]netconf.InterfaceConfig{
|
||||||
/* "eth0": netconf.InterfaceConfig{
|
/* "eth0": netconf.InterfaceConfig{
|
||||||
Addresses: []string{
|
Addresses: []string{
|
||||||
"1.2.3.4",
|
"1.2.3.4",
|
||||||
"5.6.7.8",
|
"5.6.7.8",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
*/},
|
||||||
*/},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -20,10 +20,10 @@ import (
|
|||||||
|
|
||||||
func TestFormatConfigs(t *testing.T) {
|
func TestFormatConfigs(t *testing.T) {
|
||||||
for in, n := range map[string]int{
|
for in, n := range map[string]int{
|
||||||
"": 0,
|
"": 0,
|
||||||
"line1\\\nis long": 1,
|
"line1\\\nis long": 1,
|
||||||
"#comment": 0,
|
"#comment": 0,
|
||||||
"#comment\\\ncomment": 0,
|
"#comment\\\ncomment": 0,
|
||||||
" #comment \\\n comment\nline 1\nline 2\\\n is long": 2,
|
" #comment \\\n comment\nline 1\nline 2\\\n is long": 2,
|
||||||
} {
|
} {
|
||||||
lines := formatConfig(in)
|
lines := formatConfig(in)
|
||||||
|
@ -198,11 +198,11 @@ func TestGet(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tests := map[string]interface{}{
|
tests := map[string]interface{}{
|
||||||
"key": "value",
|
"key": "value",
|
||||||
"rancher.key2.subkey": "subvalue",
|
"rancher.key2.subkey": "subvalue",
|
||||||
"rancher.key2.subnum": 42,
|
"rancher.key2.subnum": 42,
|
||||||
"rancher.key2.subkey2": "",
|
"rancher.key2.subkey2": "",
|
||||||
"foo": "",
|
"foo": "",
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v := range tests {
|
for k, v := range tests {
|
||||||
@ -241,7 +241,7 @@ func TestSet(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tests := map[string]interface{}{
|
tests := map[string]interface{}{
|
||||||
"key": "value2",
|
"key": "value2",
|
||||||
"rancher.key2.subkey": "subvalue2",
|
"rancher.key2.subkey": "subvalue2",
|
||||||
"rancher.key2.subkey2": "value",
|
"rancher.key2.subkey2": "value",
|
||||||
"rancher.key2.subkey3": 43,
|
"rancher.key2.subkey3": 43,
|
||||||
|
Loading…
Reference in New Issue
Block a user