Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0b46144
Fix some typos
tossmilestone Sep 7, 2018
6a1983e
migrated ipc integration tests to integration/container
adshmh Sep 13, 2018
8a614d1
cli: fix images filter when use multi reference filter
Nov 10, 2018
bb22158
Test: Replace NewClient() with NewClientT()
thaJeztah Dec 22, 2018
05ecb14
Don't mix t.Parallel() wth environment.ProtectAll()
thaJeztah Jan 3, 2019
e438d47
Integration: use testenv.APIClient()
thaJeztah Jan 2, 2019
cdedf9a
Improve consistency in "skip"
thaJeztah Jan 3, 2019
b4c0a7e
Only build IPCmode tests on Linux
thaJeztah Jan 3, 2019
bb6db57
Simplify skip checks
thaJeztah Jan 3, 2019
0a234f6
Fix some minor wording / issues
thaJeztah Jan 3, 2019
b9102e2
Remove use of deprecated client.NewEnvClient()
thaJeztah Jan 3, 2019
dd20556
Remove code duplication and consolidate networkIsRemoved
yongtang Jan 12, 2019
0463521
Refactor TestInspectNetwork
thaJeztah Jan 14, 2019
8f64214
Integration tests: remove some duplicated code, and preserve context
thaJeztah Jan 14, 2019
8299d03
integration-cli: remove deprecated daemonHost() utility
thaJeztah Jan 21, 2019
2c1307f
Replace deprecated client.WithDialer()
thaJeztah Dec 28, 2018
cdb4011
Use poll.WaitOn in authz_plugin_test.go
yongtang Jan 9, 2019
0923150
Add missing error-check in TestAPISwarmManagerRestore
thaJeztah Jan 13, 2019
93de031
Use assert.NilError() instead of assert.Assert()
thaJeztah Jan 21, 2019
fd6a468
Remove use of deprecated client.NewClient()
thaJeztah Jan 21, 2019
1efe472
Completely remove `d.NewClient` from testing tools
cpuguy83 Feb 6, 2019
17ae129
integration-cli: fix TestAttachDetach, rm TestAttachDetachTruncatedID
kolyshkin Aug 24, 2018
533b0f6
Windows: Go1.11: Use long path names in build context (TestBuildSymli…
Sep 5, 2018
d52a18f
TestStartReturnCorrectExitCode: show error
kolyshkin Sep 10, 2018
90cb9b6
integration-cli: fix netns test cleanup
kolyshkin Oct 5, 2018
2a02a2e
docker_cli_swarm_test.go: rm unused arg
kolyshkin Oct 25, 2018
784a893
internal/test/daemon: don't leak timers
kolyshkin Oct 25, 2018
6ec991e
docker_cli_swarm_test: factor out common code
kolyshkin Oct 29, 2018
2b498de
TestAPISwarmLeaderElection: add some debug
kolyshkin Sep 13, 2018
553b096
integration-cli/Test*Swarm*: use same args on restart
kolyshkin Oct 25, 2018
008cc8e
Remove unused ExperimentalDaemon, NotS390X, NotPausable requirement c…
thaJeztah Dec 24, 2018
3304d91
Remove SameHostDaemon, use testEnv.IsLocalDaemon instead
thaJeztah Dec 24, 2018
954425f
reduce flakiness of TestSwarmLockUnlockCluster and TestSwarmJoinPromo…
thaJeztah Jan 12, 2019
26f7e0a
Make TestEventsFilterLabels less flaky
thaJeztah Jan 13, 2019
f982379
TestUpdateRestartWithAutoRemove: use WithAutoRemove
kolyshkin Mar 8, 2019
ed48a92
integration/internal/container/ops: rm unused code
kolyshkin Feb 15, 2019
2c546aa
integration: add/use WithRestartPolicy
kolyshkin Feb 15, 2019
b228a49
TestDaemonRestartIpcMode: modernize
kolyshkin Feb 15, 2019
b60ecd3
TestSwarmContainerEndpointOptions: fix debug
kolyshkin Oct 3, 2018
45dd956
Fix typo
16yuki0702 Oct 5, 2018
8fcca0b
Remove some checkers to discourage usage
thaJeztah Apr 4, 2019
9a4d7bb
Replace some checkers and assertions with gotest.tools
thaJeztah Apr 4, 2019
7e65b69
Migrate some remaining Manifest V1 tests
thaJeztah Apr 17, 2019
e4bc7d2
Improve 'no matching manifest' error
StefanScherer Jan 15, 2019
04d0295
Use current windows servercore image
StefanScherer Apr 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ be found.
* Add `--format` option to `docker node ls` [#30424](https://github.com/docker/docker/pull/30424)
* Add `--prune` option to `docker stack deploy` to remove services that are no longer defined in the docker-compose file [#31302](https://github.com/docker/docker/pull/31302)
* Add `PORTS` column for `docker service ls` when using `ingress` mode [#30813](https://github.com/docker/docker/pull/30813)
- Fix unnescessary re-deploying of tasks when environment-variables are used [#32364](https://github.com/docker/docker/pull/32364)
- Fix unnecessary re-deploying of tasks when environment-variables are used [#32364](https://github.com/docker/docker/pull/32364)
- Fix `docker stack deploy` not supporting `endpoint_mode` when deploying from a docker compose file [#32333](https://github.com/docker/docker/pull/32333)
- Proceed with startup if cluster component cannot be created to allow recovering from a broken swarm setup [#31631](https://github.com/docker/docker/pull/31631)

Expand Down
2 changes: 1 addition & 1 deletion api/types/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ type NetworkStats struct {
RxBytes uint64 `json:"rx_bytes"`
// Packets received. Windows and Linux.
RxPackets uint64 `json:"rx_packets"`
// Received errors. Not used on Windows. Note that we dont `omitempty` this
// Received errors. Not used on Windows. Note that we don't `omitempty` this
// field as it is expected in the >=v1.21 API stats structure.
RxErrors uint64 `json:"rx_errors"`
// Incoming packets dropped. Windows and Linux.
Expand Down
2 changes: 1 addition & 1 deletion client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

func main() {
cli, err := client.NewEnvClient()
cli, err := client.NewClientWithOpts(client.FromEnv)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ For example, to list running containers (the equivalent of "docker ps"):
)

func main() {
cli, err := client.NewEnvClient()
cli, err := client.NewClientWithOpts(client.FromEnv)
if err != nil {
panic(err)
}
Expand Down
16 changes: 8 additions & 8 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"gotest.tools/skip"
)

func TestNewEnvClient(t *testing.T) {
func TestNewClientWithOpsFromEnv(t *testing.T) {
skip.If(t, runtime.GOOS == "windows")

testcases := []struct {
Expand Down Expand Up @@ -86,7 +86,7 @@ func TestNewEnvClient(t *testing.T) {
defer env.PatchAll(t, nil)()
for _, c := range testcases {
env.PatchAll(t, c.envs)
apiclient, err := NewEnvClient()
apiclient, err := NewClientWithOpts(FromEnv)
if c.expectedError != "" {
assert.Check(t, is.Error(err, c.expectedError), c.doc)
} else {
Expand Down Expand Up @@ -167,23 +167,23 @@ func TestParseHostURL(t *testing.T) {
}
}

func TestNewEnvClientSetsDefaultVersion(t *testing.T) {
func TestNewClientWithOpsFromEnvSetsDefaultVersion(t *testing.T) {
defer env.PatchAll(t, map[string]string{
"DOCKER_HOST": "",
"DOCKER_API_VERSION": "",
"DOCKER_TLS_VERIFY": "",
"DOCKER_CERT_PATH": "",
})()

client, err := NewEnvClient()
client, err := NewClientWithOpts(FromEnv)
if err != nil {
t.Fatal(err)
}
assert.Check(t, is.Equal(client.version, api.DefaultVersion))

expected := "1.22"
os.Setenv("DOCKER_API_VERSION", expected)
client, err = NewEnvClient()
client, err = NewClientWithOpts(FromEnv)
if err != nil {
t.Fatal(err)
}
Expand All @@ -195,7 +195,7 @@ func TestNewEnvClientSetsDefaultVersion(t *testing.T) {
func TestNegotiateAPIVersionEmpty(t *testing.T) {
defer env.PatchAll(t, map[string]string{"DOCKER_API_VERSION": ""})()

client, err := NewEnvClient()
client, err := NewClientWithOpts(FromEnv)
assert.NilError(t, err)

ping := types.Ping{
Expand All @@ -219,7 +219,7 @@ func TestNegotiateAPIVersionEmpty(t *testing.T) {
// TestNegotiateAPIVersion asserts that client.Client can
// negotiate a compatible APIVersion with the server
func TestNegotiateAPIVersion(t *testing.T) {
client, err := NewEnvClient()
client, err := NewClientWithOpts(FromEnv)
assert.NilError(t, err)

expected := "1.21"
Expand Down Expand Up @@ -251,7 +251,7 @@ func TestNegotiateAPVersionOverride(t *testing.T) {
expected := "9.99"
defer env.PatchAll(t, map[string]string{"DOCKER_API_VERSION": expected})()

client, err := NewEnvClient()
client, err := NewClientWithOpts(FromEnv)
assert.NilError(t, err)

ping := types.Ping{
Expand Down
2 changes: 1 addition & 1 deletion client/container_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func ExampleClient_ContainerLogs_withTimeout() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

client, _ := NewEnvClient()
client, _ := NewClientWithOpts(FromEnv)
reader, err := client.ContainerLogs(ctx, "container_id", types.ContainerLogsOptions{})
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion client/container_wait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func ExampleClient_ContainerWait_withTimeout() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

client, _ := NewEnvClient()
client, _ := NewClientWithOpts(FromEnv)
_, errC := client.ContainerWait(ctx, "container_id", "")
if err := <-errC; err != nil {
log.Fatal(err)
Expand Down
14 changes: 7 additions & 7 deletions client/hijack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestTLSCloseWriter(t *testing.T) {
break
}
}
assert.Assert(t, err)
assert.NilError(t, err)

ts.Listener = l
defer l.Close()
Expand All @@ -76,24 +76,24 @@ func TestTLSCloseWriter(t *testing.T) {
defer ts.Close()

serverURL, err := url.Parse(ts.URL)
assert.Assert(t, err)
assert.NilError(t, err)

client, err := NewClient("tcp://"+serverURL.Host, "", ts.Client(), nil)
assert.Assert(t, err)
client, err := NewClientWithOpts(WithHost("tcp://"+serverURL.Host), WithHTTPClient(ts.Client()))
assert.NilError(t, err)

resp, err := client.postHijacked(context.Background(), "/asdf", url.Values{}, nil, map[string][]string{"Content-Type": {"text/plain"}})
assert.Assert(t, err)
assert.NilError(t, err)
defer resp.Close()

if _, ok := resp.Conn.(types.CloseWriter); !ok {
t.Fatal("tls conn did not implement the CloseWrite interface")
}

_, err = resp.Conn.Write([]byte("hello"))
assert.Assert(t, err)
assert.NilError(t, err)

b, err := ioutil.ReadAll(resp.Reader)
assert.Assert(t, err)
assert.NilError(t, err)
assert.Assert(t, string(b) == "hello")
assert.Assert(t, resp.CloseWrite())

Expand Down
2 changes: 1 addition & 1 deletion client/service_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func ExampleClient_ServiceLogs_withTimeout() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

client, _ := NewEnvClient()
client, _ := NewClientWithOpts(FromEnv)
reader, err := client.ServiceLogs(ctx, "service_id", types.ContainerLogsOptions{})
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/dockerd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {

d.StoreHosts(hosts)

// validate after NewDaemon has restored enabled plugins. Dont change order.
// validate after NewDaemon has restored enabled plugins. Don't change order.
if err := validateAuthzPlugins(cli.Config.AuthorizationPlugins, pluginStore); err != nil {
return fmt.Errorf("Error validating authorization plugin: %v", err)
}
Expand Down
26 changes: 13 additions & 13 deletions daemon/daemon_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,30 +236,30 @@ func TestRootMountCleanup(t *testing.T) {
t.Parallel()

testRoot, err := ioutil.TempDir("", t.Name())
assert.Assert(t, err)
assert.NilError(t, err)
defer os.RemoveAll(testRoot)
cfg := &config.Config{}

err = mount.MakePrivate(testRoot)
assert.Assert(t, err)
assert.NilError(t, err)
defer mount.Unmount(testRoot)

cfg.ExecRoot = filepath.Join(testRoot, "exec")
cfg.Root = filepath.Join(testRoot, "daemon")

err = os.Mkdir(cfg.ExecRoot, 0755)
assert.Assert(t, err)
assert.NilError(t, err)
err = os.Mkdir(cfg.Root, 0755)
assert.Assert(t, err)
assert.NilError(t, err)

d := &Daemon{configStore: cfg, root: cfg.Root}
unmountFile := getUnmountOnShutdownPath(cfg)

t.Run("regular dir no mountpoint", func(t *testing.T) {
err = setupDaemonRootPropagation(cfg)
assert.Assert(t, err)
assert.NilError(t, err)
_, err = os.Stat(unmountFile)
assert.Assert(t, err)
assert.NilError(t, err)
checkMounted(t, cfg.Root, true)

assert.Assert(t, d.cleanupMounts())
Expand All @@ -271,11 +271,11 @@ func TestRootMountCleanup(t *testing.T) {

t.Run("root is a private mountpoint", func(t *testing.T) {
err = mount.MakePrivate(cfg.Root)
assert.Assert(t, err)
assert.NilError(t, err)
defer mount.Unmount(cfg.Root)

err = setupDaemonRootPropagation(cfg)
assert.Assert(t, err)
assert.NilError(t, err)
assert.Check(t, ensureShared(cfg.Root))

_, err = os.Stat(unmountFile)
Expand All @@ -287,11 +287,11 @@ func TestRootMountCleanup(t *testing.T) {
// mount is pre-configured with a shared mount
t.Run("root is a shared mountpoint", func(t *testing.T) {
err = mount.MakeShared(cfg.Root)
assert.Assert(t, err)
assert.NilError(t, err)
defer mount.Unmount(cfg.Root)

err = setupDaemonRootPropagation(cfg)
assert.Assert(t, err)
assert.NilError(t, err)

if _, err := os.Stat(unmountFile); err == nil {
t.Fatal("unmount file should not exist")
Expand All @@ -305,13 +305,13 @@ func TestRootMountCleanup(t *testing.T) {
// does not need mount but unmount file exists from previous run
t.Run("old mount file is cleaned up on setup if not needed", func(t *testing.T) {
err = mount.MakeShared(testRoot)
assert.Assert(t, err)
assert.NilError(t, err)
defer mount.MakePrivate(testRoot)
err = ioutil.WriteFile(unmountFile, nil, 0644)
assert.Assert(t, err)
assert.NilError(t, err)

err = setupDaemonRootPropagation(cfg)
assert.Assert(t, err)
assert.NilError(t, err)

_, err = os.Stat(unmountFile)
assert.Check(t, os.IsNotExist(err), err)
Expand Down
3 changes: 3 additions & 0 deletions daemon/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ func (i *ImageService) Images(imageFilters filters.Args, all bool, withExtraAttr
if matchErr != nil {
return nil, matchErr
}
if found {
break
}
}
if !found {
continue
Expand Down
6 changes: 3 additions & 3 deletions daemon/logger/jsonfilelog/read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ func TestEncodeDecode(t *testing.T) {

decode := decodeFunc(buf)
msg, err := decode()
assert.Assert(t, err)
assert.NilError(t, err)
assert.Assert(t, string(msg.Line) == "hello 1\n", string(msg.Line))

msg, err = decode()
assert.Assert(t, err)
assert.NilError(t, err)
assert.Assert(t, string(msg.Line) == "hello 2\n")

msg, err = decode()
assert.Assert(t, err)
assert.NilError(t, err)
assert.Assert(t, string(msg.Line) == "hello 3\n")

_, err = decode()
Expand Down
Loading