mirror of https://github.com/docker/cli.git
Merge pull request #365 from dnephin/more-codeowners
Fix shellcheck on master and other cleanup
This commit is contained in:
commit
eabdace628
|
@ -1,6 +1,7 @@
|
||||||
# Github code owners
|
# Github code owners
|
||||||
# See https://github.com/blog/2392-introducing-code-owners
|
# See https://github.com/blog/2392-introducing-code-owners
|
||||||
|
|
||||||
|
cli/command/stack/** @dnephin @vdemeester
|
||||||
cli/compose/** @dnephin @vdemeester
|
cli/compose/** @dnephin @vdemeester
|
||||||
contrib/completion/bash/** @albers
|
contrib/completion/bash/** @albers
|
||||||
contrib/completion/zsh/** @sdurrheimer
|
contrib/completion/zsh/** @sdurrheimer
|
||||||
|
|
|
@ -42,8 +42,6 @@ func (n notFound) NotFound() bool {
|
||||||
|
|
||||||
func TestValidateExternalNetworks(t *testing.T) {
|
func TestValidateExternalNetworks(t *testing.T) {
|
||||||
var testcases = []struct {
|
var testcases = []struct {
|
||||||
inspected bool
|
|
||||||
noInspect bool
|
|
||||||
inspectResponse types.NetworkResource
|
inspectResponse types.NetworkResource
|
||||||
inspectError error
|
inspectError error
|
||||||
expectedMsg string
|
expectedMsg string
|
||||||
|
@ -58,8 +56,8 @@ func TestValidateExternalNetworks(t *testing.T) {
|
||||||
expectedMsg: "Unexpected",
|
expectedMsg: "Unexpected",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
noInspect: true,
|
inspectError: errors.New("host net does not exist on swarm classic"),
|
||||||
network: "host",
|
network: "host",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
network: "user",
|
network: "user",
|
||||||
|
@ -74,15 +72,11 @@ func TestValidateExternalNetworks(t *testing.T) {
|
||||||
for _, testcase := range testcases {
|
for _, testcase := range testcases {
|
||||||
fakeClient := &network.FakeClient{
|
fakeClient := &network.FakeClient{
|
||||||
NetworkInspectFunc: func(_ context.Context, _ string, _ types.NetworkInspectOptions) (types.NetworkResource, error) {
|
NetworkInspectFunc: func(_ context.Context, _ string, _ types.NetworkInspectOptions) (types.NetworkResource, error) {
|
||||||
testcase.inspected = true
|
|
||||||
return testcase.inspectResponse, testcase.inspectError
|
return testcase.inspectResponse, testcase.inspectError
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
networks := []string{testcase.network}
|
networks := []string{testcase.network}
|
||||||
err := validateExternalNetworks(context.Background(), fakeClient, networks)
|
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 == "" {
|
if testcase.expectedMsg == "" {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1184,7 +1184,7 @@ _docker_config_create() {
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
local counter=$(__docker_pos_first_nonflag '--label|-l')
|
local counter=$(__docker_pos_first_nonflag '--label|-l')
|
||||||
if [ $cword -eq $((counter + 1)) ]; then
|
if [ "$cword" -eq $((counter + 1)) ]; then
|
||||||
_filedir
|
_filedir
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue