From 60991e943ba749ace778abac4188ad3f29b10e87 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 20 Jul 2017 12:05:20 -0400 Subject: [PATCH 1/2] Add myself to command/stack codeowners Cleanup a test Signed-off-by: Daniel Nephin --- .github/CODEOWNERS | 1 + cli/command/stack/deploy_composefile_test.go | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f3164a64b5..a14fab44c3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,6 +1,7 @@ # Github code owners # See https://github.com/blog/2392-introducing-code-owners +cli/command/stack/** @dnephin @vdemeester cli/compose/** @dnephin @vdemeester contrib/completion/bash/** @albers contrib/completion/zsh/** @sdurrheimer diff --git a/cli/command/stack/deploy_composefile_test.go b/cli/command/stack/deploy_composefile_test.go index f303fc8865..5d59ff7028 100644 --- a/cli/command/stack/deploy_composefile_test.go +++ b/cli/command/stack/deploy_composefile_test.go @@ -42,8 +42,6 @@ func (n notFound) NotFound() bool { func TestValidateExternalNetworks(t *testing.T) { var testcases = []struct { - inspected bool - noInspect bool inspectResponse types.NetworkResource inspectError error expectedMsg string @@ -58,8 +56,8 @@ func TestValidateExternalNetworks(t *testing.T) { expectedMsg: "Unexpected", }, { - noInspect: true, - network: "host", + inspectError: errors.New("host net does not exist on swarm classic"), + network: "host", }, { network: "user", @@ -74,15 +72,11 @@ func TestValidateExternalNetworks(t *testing.T) { for _, testcase := range testcases { fakeClient := &network.FakeClient{ NetworkInspectFunc: func(_ context.Context, _ string, _ types.NetworkInspectOptions) (types.NetworkResource, error) { - testcase.inspected = true return testcase.inspectResponse, testcase.inspectError }, } networks := []string{testcase.network} err := validateExternalNetworks(context.Background(), fakeClient, networks) - if testcase.noInspect && testcase.inspected { - assert.Fail(t, "expected no network inspect operation but one occurent") - } if testcase.expectedMsg == "" { assert.NoError(t, err) } else { From 14d2c95d4a10503e39770da10128b6190d610437 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 20 Jul 2017 12:11:27 -0400 Subject: [PATCH 2/2] Fix shellcheck on master Signed-off-by: Daniel Nephin --- contrib/completion/bash/docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 9539d50878..66174729d0 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1184,7 +1184,7 @@ _docker_config_create() { ;; *) local counter=$(__docker_pos_first_nonflag '--label|-l') - if [ $cword -eq $((counter + 1)) ]; then + if [ "$cword" -eq $((counter + 1)) ]; then _filedir fi ;;