Skip to content

Commit

Permalink
Merge pull request #3224 from thaJeztah/20.10_backport_bump_go_1.16.6
Browse files Browse the repository at this point in the history
[20.10 backport] Bump go 1.16.6
  • Loading branch information
thaJeztah authored Jul 29, 2021
2 parents a6f6b5f + 0b924e5 commit 3967b7d
Show file tree
Hide file tree
Showing 22 changed files with 191 additions and 149 deletions.
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# syntax=docker/dockerfile:1.3

ARG BASE_VARIANT=alpine
ARG GO_VERSION=1.13.15
ARG GO_VERSION=1.16.6

FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${BASE_VARIANT} AS gostable
FROM --platform=$BUILDPLATFORM golang:1.16-${BASE_VARIANT} AS golatest

FROM gostable AS go-linux
FROM golatest AS go-darwin
FROM golatest AS go-windows-amd64
FROM golatest AS go-windows-386
FROM golatest AS go-windows-arm
FROM --platform=$BUILDPLATFORM golang:1.17rc1-${BASE_VARIANT} AS go-windows-arm64
FROM --platform=$BUILDPLATFORM golang:1.17rc1-${BASE_VARIANT} AS golatest

FROM gostable AS go-linux
FROM gostable AS go-darwin
FROM gostable AS go-windows-amd64
FROM gostable AS go-windows-386
FROM gostable AS go-windows-arm
FROM golatest AS go-windows-arm64
FROM go-windows-${TARGETARCH} AS go-windows

FROM --platform=$BUILDPLATFORM tonistiigi/xx@sha256:620d36a9d7f1e3b102a5c7e8eff12081ac363828b3a44390f24fa8da2d49383d AS xx
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ clone_folder: c:\gopath\src\github.com\docker\cli

environment:
GOPATH: c:\gopath
GOVERSION: 1.13.15
GOVERSION: 1.16.6
DEPVERSION: v0.4.1

install:
Expand Down
19 changes: 0 additions & 19 deletions cli/command/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"crypto/x509"
"fmt"
"io/ioutil"
"net/http"
"os"
"runtime"
"testing"
Expand Down Expand Up @@ -80,24 +79,6 @@ func TestNewAPIClientFromFlagsWithAPIVersionFromEnv(t *testing.T) {
assert.Check(t, is.Equal(customVersion, apiclient.ClientVersion()))
}

func TestNewAPIClientFromFlagsWithHttpProxyEnv(t *testing.T) {
defer env.Patch(t, "HTTP_PROXY", "http://proxy.acme.com:1234")()
defer env.Patch(t, "DOCKER_HOST", "tcp://docker.acme.com:2376")()

opts := &flags.CommonOptions{}
configFile := &configfile.ConfigFile{}
apiclient, err := NewAPIClientFromFlags(opts, configFile)
assert.NilError(t, err)
transport, ok := apiclient.HTTPClient().Transport.(*http.Transport)
assert.Assert(t, ok)
assert.Assert(t, transport.Proxy != nil)
request, err := http.NewRequest(http.MethodGet, "tcp://docker.acme.com:2376", nil)
assert.NilError(t, err)
url, err := transport.Proxy(request)
assert.NilError(t, err)
assert.Check(t, is.Equal("http://proxy.acme.com:1234", url.String()))
}

type fakeClient struct {
client.Client
pingFunc func() (types.Ping, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/command/container/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func TestCreateContainerImagePullPolicy(t *testing.T) {
return ioutil.NopCloser(strings.NewReader("")), nil
},
infoFunc: func() (types.Info, error) {
return types.Info{IndexServerAddress: "http://indexserver"}, nil
return types.Info{IndexServerAddress: "https://indexserver.example.com"}, nil
},
}
cli := test.NewFakeCli(client)
Expand Down
6 changes: 3 additions & 3 deletions cli/command/context/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func validateTestKubeEndpoint(t *testing.T, s store.Reader, name string) {
kubeMeta := ctxMetadata.Endpoints[kubernetes.KubernetesEndpoint].(kubernetes.EndpointMeta)
kubeEP, err := kubeMeta.WithTLSData(s, name)
assert.NilError(t, err)
assert.Equal(t, "https://someserver", kubeEP.Host)
assert.Equal(t, "https://someserver.example.com", kubeEP.Host)
assert.Equal(t, "the-ca", string(kubeEP.TLSData.CA))
assert.Equal(t, "the-cert", string(kubeEP.TLSData.Cert))
assert.Equal(t, "the-key", string(kubeEP.TLSData.Key))
Expand Down Expand Up @@ -287,7 +287,7 @@ func TestCreateFromContext(t *testing.T) {
assert.Equal(t, newContextTyped.Description, c.expectedDescription)
assert.Equal(t, newContextTyped.StackOrchestrator, c.expectedOrchestrator)
assert.Equal(t, dockerEndpoint.Host, "tcp://42.42.42.42:2375")
assert.Equal(t, kubeEndpoint.Host, "https://someserver")
assert.Equal(t, kubeEndpoint.Host, "https://someserver.example.com")
})
}
}
Expand Down Expand Up @@ -361,7 +361,7 @@ func TestCreateFromCurrent(t *testing.T) {
assert.Equal(t, newContextTyped.Description, c.expectedDescription)
assert.Equal(t, newContextTyped.StackOrchestrator, c.expectedOrchestrator)
assert.Equal(t, dockerEndpoint.Host, "tcp://42.42.42.42:2375")
assert.Equal(t, kubeEndpoint.Host, "https://someserver")
assert.Equal(t, kubeEndpoint.Host, "https://someserver.example.com")
})
}
}
2 changes: 1 addition & 1 deletion cli/command/context/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func createTestContextWithKubeAndSwarm(t *testing.T, cli command.Cli, name strin
DefaultStackOrchestrator: orchestrator,
Description: "description of " + name,
Kubernetes: map[string]string{keyFrom: "default"},
Docker: map[string]string{keyHost: "https://someswarmserver"},
Docker: map[string]string{keyHost: "https://someswarmserver.example.com"},
})
assert.NilError(t, err)
}
Expand Down
4 changes: 2 additions & 2 deletions cli/command/context/testdata/inspect.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
},
"Endpoints": {
"docker": {
"Host": "https://someswarmserver",
"Host": "https://someswarmserver.example.com",
"SkipTLSVerify": false
},
"kubernetes": {
"Host": "https://someserver",
"Host": "https://someserver.example.com",
"SkipTLSVerify": false,
"DefaultNamespace": "default"
}
Expand Down
10 changes: 5 additions & 5 deletions cli/command/context/testdata/list.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
current * description of current https://someswarmserver https://someserver (default) all
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock swarm
other description of other https://someswarmserver https://someserver (default) all
unset description of unset https://someswarmserver https://someserver (default)
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
current * description of current https://someswarmserver.example.com https://someserver.example.com (default) all
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock swarm
other description of other https://someswarmserver.example.com https://someserver.example.com (default) all
unset description of unset https://someswarmserver.example.com https://someserver.example.com (default)
2 changes: 1 addition & 1 deletion cli/command/context/testdata/test-kubeconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
clusters:
- cluster:
certificate-authority-data: dGhlLWNh
server: https://someserver
server: https://someserver.example.com
name: test-cluster
contexts:
- context:
Expand Down
6 changes: 3 additions & 3 deletions cli/command/image/trust_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ import (
)

func TestENVTrustServer(t *testing.T) {
defer env.PatchAll(t, map[string]string{"DOCKER_CONTENT_TRUST_SERVER": "https://notary-test.com:5000"})()
defer env.PatchAll(t, map[string]string{"DOCKER_CONTENT_TRUST_SERVER": "https://notary-test.example.com:5000"})()
indexInfo := &registrytypes.IndexInfo{Name: "testserver"}
output, err := trust.Server(indexInfo)
expectedStr := "https://notary-test.com:5000"
expectedStr := "https://notary-test.example.com:5000"
if err != nil || output != expectedStr {
t.Fatalf("Expected server to be %s, got %s", expectedStr, output)
}
}

func TestHTTPENVTrustServer(t *testing.T) {
defer env.PatchAll(t, map[string]string{"DOCKER_CONTENT_TRUST_SERVER": "http://notary-test.com:5000"})()
defer env.PatchAll(t, map[string]string{"DOCKER_CONTENT_TRUST_SERVER": "http://notary-test.example.com:5000"})()
indexInfo := &registrytypes.IndexInfo{Name: "testserver"}
_, err := trust.Server(indexInfo)
if err == nil {
Expand Down
4 changes: 2 additions & 2 deletions cli/command/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ func TestElectAuthServer(t *testing.T) {
},
},
{
expectedAuthServer: "https://foo.bar",
expectedAuthServer: "https://foo.example.com",
expectedWarning: "",
infoFunc: func() (types.Info, error) {
return types.Info{IndexServerAddress: "https://foo.bar"}, nil
return types.Info{IndexServerAddress: "https://foo.example.com"}, nil
},
},
{
Expand Down
14 changes: 7 additions & 7 deletions cli/command/swarm/ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,20 @@ func TestDisplayTrustRootInvalidFlags(t *testing.T) {
errorMsg: "flag requires the `--rotate` flag to update the CA",
},
{
args: []string{"--external-ca=protocol=cfssl,url=https://some.com/https/url"},
args: []string{"--external-ca=protocol=cfssl,url=https://some.example.com/https/url"},
errorMsg: "flag requires the `--rotate` flag to update the CA",
},
{ // to make sure we're not erroring because we didn't provide a CA cert and external CA
args: []string{
"--ca-cert=" + tmpfile,
"--external-ca=protocol=cfssl,url=https://some.com/https/url",
"--external-ca=protocol=cfssl,url=https://some.example.com/https/url",
},
errorMsg: "flag requires the `--rotate` flag to update the CA",
},
{
args: []string{
"--rotate",
"--external-ca=protocol=cfssl,url=https://some.com/https/url",
"--external-ca=protocol=cfssl,url=https://some.example.com/https/url",
},
errorMsg: "rotating to an external CA requires the `--ca-cert` flag to specify the external CA's cert - " +
"to add an external CA with the current root CA certificate, use the `update` command instead",
Expand Down Expand Up @@ -243,7 +243,7 @@ func TestUpdateSwarmSpecCertAndExternalCA(t *testing.T) {
"--rotate",
"--detach",
"--ca-cert=" + certfile,
"--external-ca=protocol=cfssl,url=https://some.external.ca"})
"--external-ca=protocol=cfssl,url=https://some.external.ca.example.com"})
cmd.SetOut(cli.OutBuffer())
assert.NilError(t, cmd.Execute())

Expand All @@ -253,7 +253,7 @@ func TestUpdateSwarmSpecCertAndExternalCA(t *testing.T) {
expected.CAConfig.ExternalCAs = []*swarm.ExternalCA{
{
Protocol: swarm.ExternalCAProtocolCFSSL,
URL: "https://some.external.ca",
URL: "https://some.external.ca.example.com",
CACert: cert,
Options: make(map[string]string),
},
Expand Down Expand Up @@ -281,7 +281,7 @@ func TestUpdateSwarmSpecCertAndKeyAndExternalCA(t *testing.T) {
"--detach",
"--ca-cert=" + certfile,
"--ca-key=" + keyfile,
"--external-ca=protocol=cfssl,url=https://some.external.ca"})
"--external-ca=protocol=cfssl,url=https://some.external.ca.example.com"})
cmd.SetOut(cli.OutBuffer())
assert.NilError(t, cmd.Execute())

Expand All @@ -291,7 +291,7 @@ func TestUpdateSwarmSpecCertAndKeyAndExternalCA(t *testing.T) {
expected.CAConfig.ExternalCAs = []*swarm.ExternalCA{
{
Protocol: swarm.ExternalCAProtocolCFSSL,
URL: "https://some.external.ca",
URL: "https://some.external.ca.example.com",
CACert: cert,
Options: make(map[string]string),
},
Expand Down
Loading

0 comments on commit 3967b7d

Please sign in to comment.