Skip to content

Commit c424be2

Browse files
committed
Clean some stuff from runconfig that are cli only…
… or could be in `opts` package. Having `runconfig/opts` and `opts` doesn't really make sense and make it difficult to know where to put some code. Signed-off-by: Vincent Demeester <[email protected]>
1 parent d1dfc1a commit c424be2

35 files changed

+1418
-1417
lines changed

cli/command/container/create.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
apiclient "github.com/docker/docker/client"
1919
"github.com/docker/docker/reference"
2020
"github.com/docker/docker/registry"
21-
runconfigopts "github.com/docker/docker/runconfig/opts"
2221
"github.com/spf13/cobra"
2322
"github.com/spf13/pflag"
2423
)
@@ -30,7 +29,7 @@ type createOptions struct {
3029
// NewCreateCommand creates a new cobra.Command for `docker create`
3130
func NewCreateCommand(dockerCli *command.DockerCli) *cobra.Command {
3231
var opts createOptions
33-
var copts *runconfigopts.ContainerOptions
32+
var copts *containerOptions
3433

3534
cmd := &cobra.Command{
3635
Use: "create [OPTIONS] IMAGE [COMMAND] [ARG...]",
@@ -55,12 +54,12 @@ func NewCreateCommand(dockerCli *command.DockerCli) *cobra.Command {
5554
flags.Bool("help", false, "Print usage")
5655

5756
command.AddTrustedFlags(flags, true)
58-
copts = runconfigopts.AddFlags(flags)
57+
copts = addFlags(flags)
5958
return cmd
6059
}
6160

62-
func runCreate(dockerCli *command.DockerCli, flags *pflag.FlagSet, opts *createOptions, copts *runconfigopts.ContainerOptions) error {
63-
config, hostConfig, networkingConfig, err := runconfigopts.Parse(flags, copts)
61+
func runCreate(dockerCli *command.DockerCli, flags *pflag.FlagSet, opts *createOptions, copts *containerOptions) error {
62+
config, hostConfig, networkingConfig, err := parse(flags, copts)
6463
if err != nil {
6564
reportError(dockerCli.Err(), "create", err.Error(), true)
6665
return cli.StatusError{StatusCode: 125}

cli/command/container/exec.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
apiclient "github.com/docker/docker/client"
1414
options "github.com/docker/docker/opts"
1515
"github.com/docker/docker/pkg/promise"
16-
runconfigopts "github.com/docker/docker/runconfig/opts"
1716
"github.com/spf13/cobra"
1817
)
1918

@@ -30,7 +29,7 @@ type execOptions struct {
3029
func newExecOptions() *execOptions {
3130
var values []string
3231
return &execOptions{
33-
env: options.NewListOptsRef(&values, runconfigopts.ValidateEnv),
32+
env: options.NewListOptsRef(&values, options.ValidateEnv),
3433
}
3534
}
3635

cli/command/container/opts.go

Lines changed: 899 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)