Skip to content

Commit

Permalink
Make linter happier
Browse files Browse the repository at this point in the history
Signed-off-by: Zander Mackie <zmackie@gmail.com>
  • Loading branch information
Zander Mackie committed Nov 6, 2018
1 parent 96d056d commit 58517d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions cli/command/container/create.go
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/spf13/pflag"
)

// Pull constants
const (
PullImageAlways = "always"
PullImageMissing = "missing"
Expand Down Expand Up @@ -168,6 +169,7 @@ func newCIDFile(path string) (*cidFile, error) {
return &cidFile{path: path, file: f}, nil
}

// nolint: gocyclo
func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig *containerConfig, opts *createOptions) (*container.ContainerCreateCreatedBody, error) {
config := containerConfig.Config
hostConfig := containerConfig.HostConfig
Expand Down Expand Up @@ -242,6 +244,9 @@ func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig
}
}
response, err = dockerCli.Client().ContainerCreate(ctx, config, hostConfig, networkingConfig, opts.name)
if err != nil {
return nil, err
}

} else if opts.pull == PullImageNever { // Never try and pull the image
response, err = dockerCli.Client().ContainerCreate(ctx, config, hostConfig, networkingConfig, opts.name)
Expand Down
3 changes: 0 additions & 3 deletions cli/command/container/create_test.go
Expand Up @@ -73,7 +73,6 @@ func TestCIDFileCloseWithWrite(t *testing.T) {
assert.NilError(t, err)
}

//Modify this test
func TestCreateContainerPullsImageIfMissing(t *testing.T) {
imageName := "does-not-exist-locally"
responseCounter := 0
Expand Down Expand Up @@ -123,11 +122,9 @@ func TestCreateContainerPullsImageIfMissing(t *testing.T) {
assert.Check(t, is.Contains(stderr, "Unable to find image 'does-not-exist-locally:latest' locally"))
}

//Modify this test
func TestCreateContainerNeverPullsImage(t *testing.T) {
imageName := "does-not-exist-locally"
responseCounter := 0
containerID := "abcdef"

client := &fakeClient{
createContainerFunc: func(
Expand Down

0 comments on commit 58517d0

Please sign in to comment.