Skip to content

Commit a37006f

Browse files
committed
fix updateOptions not being initialized
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 8363999 commit a37006f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

cli/command/container/update.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ type updateOptions struct {
4343

4444
// newUpdateCommand creates a new cobra.Command for "docker container update".
4545
func newUpdateCommand(dockerCLI command.Cli) *cobra.Command {
46-
var options updateOptions
46+
options := &updateOptions{
47+
blkioWeightDevice: opts.NewWeightdeviceOpt(opts.ValidateWeightDevice),
48+
deviceReadBps: opts.NewThrottledeviceOpt(opts.ValidateThrottleBpsDevice),
49+
deviceReadIOps: opts.NewThrottledeviceOpt(opts.ValidateThrottleIOpsDevice),
50+
deviceWriteBps: opts.NewThrottledeviceOpt(opts.ValidateThrottleBpsDevice),
51+
deviceWriteIOps: opts.NewThrottledeviceOpt(opts.ValidateThrottleIOpsDevice),
52+
}
4753

4854
cmd := &cobra.Command{
4955
Use: "update [OPTIONS] CONTAINER [CONTAINER...]",
@@ -52,7 +58,7 @@ func newUpdateCommand(dockerCLI command.Cli) *cobra.Command {
5258
RunE: func(cmd *cobra.Command, args []string) error {
5359
options.containers = args
5460
options.nFlag = cmd.Flags().NFlag()
55-
return runUpdate(cmd.Context(), dockerCLI, &options)
61+
return runUpdate(cmd.Context(), dockerCLI, options)
5662
},
5763
Annotations: map[string]string{
5864
"aliases": "docker container update, docker update",

0 commit comments

Comments
 (0)