Commit Graph

7 Commits

Author SHA1 Message Date
Silvin Lubecki 296297190c
opts/throttledevice.go:51:5: SA4003: unsigned values are never < 0 (staticcheck)
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-31 19:21:55 +01:00
Daniel Nephin 3bf0317fea Add unconvert linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-14 16:54:27 -07:00
Sebastiaan van Stijn ab92626619 Improve usage output for docker run
Commit a77f2450c70312f8c26877a18bfe2baa44d4abb9 switched `docker run`
to use the `pflags` package. Due to this change, the usage output for
the `--blkio-weight-device` and `--device-*` flags changed and now
showed `weighted-device`, and `throttled-device` as value type. As a
result, the output of `docker run --help` became a lot wider.

This patch changes the output to show `list` instead, which is
consistent with other options that allow to be set multiple times.

Output before this change;

    Usage:	docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

    Run a command in a new container

    Options:
          --blkio-weight uint16                   Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
          --blkio-weight-device weighted-device   Block IO weight (relative device weight) (default [])
          --device list                           Add a host device to the container (default [])
          --device-read-bps throttled-device      Limit read rate (bytes per second) from a device (default [])
          --device-read-iops throttled-device     Limit read rate (IO per second) from a device (default [])
          --device-write-bps throttled-device     Limit write rate (bytes per second) to a device (default [])
          --device-write-iops throttled-device    Limit write rate (IO per second) to a device (default [])
      -w, --workdir string                        Working directory inside the container

Output after this change;

    Usage:	docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

    Run a command in a new container

    Options:
          --blkio-weight uint16         Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
          --blkio-weight-device list    Block IO weight (relative device weight) (default [])
          --device list                 Add a host device to the container (default [])
          --device-read-bps list        Limit read rate (bytes per second) from a device (default [])
          --device-read-iops list       Limit read rate (IO per second) from a device (default [])
          --device-write-bps list       Limit write rate (bytes per second) to a device (default [])
          --device-write-iops list      Limit write rate (IO per second) to a device (default [])
      -w, --workdir string              Working directory inside the container

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-05-15 11:57:20 +02:00
Vincent Demeester 8b725e10e7 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 <vincent@sbr.pm>
2017-05-15 11:57:20 +02:00
Daniel Nephin 5d99388c23 Move runconfig blkiodev options and parsing into runconfig/opts package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-05-15 11:57:17 +02:00
David Calavera 757d284759 Move blkiodev package to types.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2017-05-15 11:57:17 +02:00
Ma Shimiao 02a6d3c5e6 Add support for blkio read/write bps device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-05-15 11:57:16 +02:00