Commit Graph

24 Commits

Author SHA1 Message Date
Aleksa Sarai 21a005d074
list: stop casting unknown UIDs to their unicode values
If a container is owned by a UID that is not listed in /etc/passwd,
previously we would cast the UID to a string which contained a character
with the unicode value of the UID. This is clearly wrong, switch to
using fmt.Sprintf as intended.

In addition, notate unknown users with a leading '#' in the column. This
is necessary to ensure that a user is not under the impression that the
UID is the same as a numeric username.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-07-12 06:30:01 +10:00
Aleksa Sarai d2f49696b0
runc: add support for rootless containers
This enables the support for the rootless container mode. There are many
restrictions on what rootless containers can do, so many different runC
commands have been disabled:

* runc checkpoint
* runc events
* runc pause
* runc ps
* runc restore
* runc resume
* runc update

The following commands work:

* runc create
* runc delete
* runc exec
* runc kill
* runc list
* runc run
* runc spec
* runc state

In addition, any specification options that imply joining cgroups have
also been disabled. This is due to support for unprivileged subtree
management not being available from Linux upstream.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-03-23 20:45:24 +11:00
Zhang Wei b517076907 Check args numbers before application start
Add a general args number validator for all client commands.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-11-29 11:18:51 +08:00
Michael Crosby 4350d90043 Use same state object for state and list
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-19 09:18:24 -07:00
Michael Crosby 3ada88c9e7 Continue for list on errors
This will print out the error on stderr when loading a container but
still list everything that was sucessful.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-14 14:26:03 -07:00
Michael Crosby 4294d882b1 Return 0 for pid if container is stopped
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-08-25 09:44:48 -07:00
Qiang Huang 7e3eb32561 Add runc list man change
Follow up https://github.com/opencontainers/runc/pull/939

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-19 08:56:25 +08:00
Mike Brown 50dbe5f474 address issue #797 by adding additional documentation
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2016-07-11 09:31:07 -05:00
Mrunal Patel c0461277f9 Merge pull request #879 from hqhq/list_use_cli_default
Use cli default value for list format
2016-06-13 16:06:13 -07:00
Mrunal Patel a753b06645 Replace github.com/codegangsta/cli by github.com/urfave/cli
The package got moved to a different repository

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-06-06 11:47:20 -07:00
Qiang Huang d8e840e8f9 Use cli default value for list format
For consistency.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-06-04 16:57:13 +08:00
Michael Crosby 5abffd3100 Add annotations to list and state output
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-06-02 12:44:43 -07:00
Zhao Lei 7d5779fdee manual: list: Move description contents into OPTIONS field
The description contents in manual is for --format argument
actually, see:
 # ./runc list --help
 ...
 OPTIONS:
    --format, -f         select one of: table or json.

 The default format is table.  The following will output the list of containers
 in json format:

     # runc list -f json
    --quiet, -q  display only container IDs
 #

This patch move above content into right place, and remove the command
example which is not necessary.

Suggested-by: Aleksa Sarai <asarai@suse.de>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-05-25 17:18:30 +08:00
Qiang Huang 8477638aab Update cli package
The old one has bug when showing help message for IntFlags.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-05-10 13:58:09 +08:00
Michael Crosby bb8591138b Add json format to ps command
For programatic parsing add a json format option to the new `runc ps`
command.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-25 15:21:07 -07:00
Mrunal Patel 852d20b0c6 Add -q to list to print only container IDs
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-04-14 16:19:33 -07:00
George Lestaris f7ae27bfb7 HookState adhears to OCI
Signed-off-by: George Lestaris <glestaris@pivotal.io>
Signed-off-by: Ed King <eking@pivotal.io>
2016-04-06 16:57:59 +01:00
rajasec 11f024a85f Changing from logrus to fatal in list
Signed-off-by: rajasec <rajasec79@gmail.com>
2016-03-12 08:46:30 +05:30
Michael Crosby f23ff4d194 Fix bundle path for exec
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-25 10:29:48 -08:00
Michael Crosby ac43d4a0ab Save bundle path in labels
This saves and returns the bundle path for the container in the
container's config and state.  It also returns the information via runc
list.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-24 11:11:10 -08:00
Mike Brown 160daf293e adding --format json to list command
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2016-02-18 22:07:04 -06:00
Mike Brown 80495833ae adding format options to list command
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2016-02-17 08:46:06 -06:00
Michael Crosby 1172a1e1e5 Update list command and created methods
We don't need a CreatedTime method on the container because it's not
part of the interface and can be received via the state.  We also do not
need to call it CreateTime because the type of this field is time.Time
so we know its time.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-01-28 13:32:24 -08:00
Mike Brown 4c871267db adds list command, and a timestamp in the container state
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2016-01-28 14:21:06 -06:00