mirror of
https://github.com/docker/cli.git
synced 2026-01-26 15:41:42 +03:00
cli/command/container: createContainer: remove redundant closure
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -318,15 +318,8 @@ func createContainer(ctx context.Context, dockerCLI command.Cli, containerCfg *c
|
||||
platform = &p
|
||||
}
|
||||
|
||||
pullAndTagImage := func() error {
|
||||
if err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if options.pull == PullImageAlways {
|
||||
if err := pullAndTagImage(); err != nil {
|
||||
if err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
@@ -349,7 +342,7 @@ func createContainer(ctx context.Context, dockerCLI command.Cli, containerCfg *c
|
||||
_, _ = fmt.Fprintf(dockerCLI.Err(), "Unable to find image '%s' locally\n", reference.FamiliarString(namedRef))
|
||||
}
|
||||
|
||||
if err := pullAndTagImage(); err != nil {
|
||||
if err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user