summaryrefslogtreecommitdiff
path: root/cmd/podman/ps.go
Commit message (Collapse)AuthorAge
* Remove 'podman ps' restarting filter and fix stoppedMatthew Heon2019-03-08
| | | | | | | | | | | | | | Podman has no concept of a "restarting" container - such a container is just transitioning from running to stopped and then back to running through our ordinary state machine. As such, filtering "restarting" containers doesn't work and does nothing. Also, make "stopped" containers show as exited - this is a momentary state we transition to before proper exited. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Fix help commands to show short and long description.Daniel J Walsh2019-03-07
| | | | | | Cleanup lots of help information to look good when displayed. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Fix aliased commands to actually workDaniel J Walsh2019-03-03
| | | | | | | | | | | | | | | | | The current aliased commands podman container list and podman image list podman image rm Do not work properly. The global storage options are broken. This patch fixes this issue. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #2452 from edsantiago/no_more_argsOpenShift Merge Robot2019-03-01
|\ | | | | Command-line input validation: reject unused args
| * Command-line input validation: reject unused argsEd Santiago2019-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several podman commands accept no subcommands. Some of those were not actually checking, though, which could lead to user confusion. Added validation where missing; and, refactored to minimize duplication. (Side note: I decided against using cobra.NoArgs because its error message, "unknown command", misleadingly implies that there are known ones). Also added validation to varlink Signed-off-by: Ed Santiago <santiago@redhat.com>
* | fix up a number of misplace commandsbaude2019-02-28
|/ | | | | | | | | * ps now on main command * sign is no longer on main commmand * ls, list no longer are valid main aliases for images * ls, list does work for podman image Signed-off-by: baude <bbaude@redhat.com>
* fix up a number of misplace commandsbaude2019-02-27
| | | | | | | | | * ps now on main command * sign is no longer on main commmand * ls, list no longer are valid main aliases for images * ls, list does work for podman image Signed-off-by: baude <bbaude@redhat.com>
* hide --latest on the remote-clientbaude2019-02-22
| | | | | | | | in the case of the remote-client, it was decided to hide the latest flag to avoid confusion for end-users on what the "last" container, volume, or pod are. Signed-off-by: baude <bbaude@redhat.com>
* OpenTracing support added to start, stop, run, create, pull, and psSebastian Jug2019-02-18
| | | | | | Drop context.Context field from cli.Context Signed-off-by: Sebastian Jug <sejug@redhat.com>
* Second chunk of Cobra helpTomSweeneyRedHat2019-02-15
| | | | | | | | Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com> Adds examples to Cobra help for a second chunk of commands. Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
* Don't show global flags except for podman commandDaniel J Walsh2019-02-12
| | | | | | | | | Subcommands should not be showing the global flags. This causes the important information to scroll off the screen. Also fixed a typo on runCommmand (Too many 'm's) Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Separate remote and local commandsbaude2019-02-11
| | | | | | | | In the previous CLI, we had an accurate depiction of commands available for the remote client and those available for the local client. Signed-off-by: baude <bbaude@redhat.com>
* Migrate to cobra CLIbaude2019-02-08
| | | | | | | | We intend to migrate to the cobra cli from urfave/cli because the project is more well maintained. There are also some technical reasons as well which extend into our remote client work. Signed-off-by: baude <bbaude@redhat.com>
* Fix regression in ps with custom formatbaude2019-01-30
| | | | | | | | | Using the table keyword in go templating had regressed and was no longer working. Fixes: 2221 Signed-off-by: baude <bbaude@redhat.com>
* Allow alias for list, ls, ps to workDaniel J Walsh2018-12-23
| | | | | | | | Allow multiple alias for listing containers and images. Also fix documentation for umount and unmount Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Add --sync flag to podman psMatthew Heon2018-12-06
| | | | | | | | | | | The previous commit added support for --sync to podman rm to ensure state inconsistencies would not prevent containers from being removed. Add the flag to podman ps as well, so that all containers can be forcibly synced and all state inconsistencies resolved. Signed-off-by: Matthew Heon <mheon@redhat.com>
* add pod short option to psbaude2018-11-30
| | | | | | podman ps has a flag --pod; simply adding a short option of -p Signed-off-by: baude <bbaude@redhat.com>
* Merge pull request #1724 from baude/psformatchangesOpenShift Merge Robot2018-10-29
|\ | | | | make various changes to ps output
| * make various changes to ps outputbaude2018-10-29
| | | | | | | | | | | | | | | | | | | | | | | | | | for backwards compatibility and auto-test, we needed a few changes that slipped in when i reworked ps to be faster to be reverted. the follow behaviours were reverted: 1. the is_infra column was redacted. that appears to be a mistake on my part. 2. a newline after ps prints its format was added 3. a newline prior to printing the headers was removed. Signed-off-by: baude <bbaude@redhat.com>
* | Use two spaces to pad PS fieldsbaude2018-10-29
|/ | | | | | | Ed has asked that we revert to using two spaces for padding between PS fields. I assume this is for docker autotests. Signed-off-by: baude <bbaude@redhat.com>
* fix bug in rm -fa parallel deletesbaude2018-10-25
| | | | Signed-off-by: baude <bbaude@redhat.com>
* Add --max-workers and heuristics for parallel operationsbaude2018-10-25
| | | | | | | | | | add a global flag for --max-workers so users can limit the number of parallel operations for a given function. also, when not limited by max-workers, we implement a heuristic function that returns the number of preferred parallel workers based on the number of CPUs and the given operation. Signed-off-by: baude <bbaude@redhat.com>
* Make podman ps fastbaude2018-10-23
| | | | | | Like Ricky Bobby, we want to go fast. Signed-off-by: baude <bbaude@redhat.com>
* Sort all command flagsQi Wang2018-10-11
| | | | Signed-off-by: Qi Wang <qiwan@redhat.com>
* Address review comments and fix ps outputMatthew Heon2018-10-02
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Fix nameing of Namespaces to be more consistentDaniel J Walsh2018-09-06
| | | | | | | | | | Figuring out the difference between a User and a USERNS as well as Cgroup and CGROUPNS Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1417 Approved by: TomSweeneyRedHat
* don't print help message for usage errorsValentin Rothberg2018-08-31
| | | | | | | | | | | | | | | | | Don't print potentially verbose help messages in case of usage errors, but print only the usage error followed by a pointer to the command's help. This aligns with Docker. ``` $ podman run -h flag needs an argument: -h See 'podman run --help'. ``` Signed-off-by: Valentin Rothberg <vrothberg@suse.com> Closes: #1379 Approved by: rhatdan
* Fix handling of multiple filters in podman psMatthew Heon2018-08-27
| | | | | | | | | | | | | Docker expects multiple filters to be passed with multiple uses of the --filter flag (e.g. --filter=label=a=b --filter=label=c=d) and not a single comma-separated list of filters as we expected. Convert to the Docker format, and make some small cleanups to our handling of filters along the way. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #1345 Approved by: umohnani8
* Change pause container to infra containerhaircommander2018-08-23
| | | | | | | Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1187 Approved by: mheon
* Added option to share kernel namespaces in libpod and podmanhaircommander2018-08-23
| | | | | | | | | A pause container is added to the pod if the user opts in. The default pause image and command can be overridden. Pause containers are ignored in ps unless the -a option is present. Pod inspect and pod ps show shared namespaces and pause container. A pause container can't be removed with podman rm, and a pod can be removed if it only has a pause container. Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1187 Approved by: mheon
* Don't fail on size.Daniel J Walsh2018-08-17
| | | | | | | | | | I think a created container which was never run will have no size struct we should just return 0 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1288 Approved by: TomSweeneyRedHat
* Change batchcontainer to sharedhaircommander2018-08-16
| | | | | | | | | To better reflect it's usage: to share functions between podman and varlink. Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1275 Approved by: mheon
* switch projectatomic to containersDaniel J Walsh2018-08-16
| | | | | | | | | | Need to get some small changes into libpod to pull back into buildah to complete buildah transition. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1270 Approved by: mheon
* Improve ps handling of container start/stop timeMatthew Heon2018-08-08
| | | | | | | | | | | | | | Previously all calculations were done based off the container's start time. Retrieve end time and use it to calculate time stopped for containers. Also, convert ps JSON output to report timestamps for create, start, and stop times. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #1228 Approved by: rhatdan
* Added ps --pod optionhaircommander2018-08-02
| | | | | | | Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1205 Approved by: rhatdan
* Fix ps filter with key=value labelsJoshua Roys2018-07-16
| | | | | Closes: #1101 Approved by: rhatdan
* Change logic for detecting conflicting flags in psMatthew Heon2018-07-13
| | | | | | | | | | | | There's no reason --size cannot be used together with a Go template - in fact, using a Go template for {{.Size}} without --size being passed will not work. Allow use of --namespace and --size with Go templates, but not with --quiet. Do not allow --namespace and --size at the same time. Signed-off-by: Matthew Heon <mheon@redhat.com>
* Only print container size JSON if --size was requestedMatthew Heon2018-07-13
| | | | | | | To do this, move it into a separate struct, and embed that in the JSON we return. Signed-off-by: Matthew Heon <mheon@redhat.com>
* Don't print rootfs and rw sizes if they're emptyMatthew Heon2018-07-13
| | | | | | | | | | | | We're printing them unconditionally now, even if --size is not passed, which is confusing (you see a pair of 0s for container size, when it is clearly not 0). This may introduce bugs related to containers with an rwsize of 0 (freshly created from an image) and --size specified, but is definitely better than what we have now. Signed-off-by: Matthew Heon <mheon@redhat.com>
* Major fixes to podman ps --format=json outputMatthew Heon2018-07-13
| | | | | | | | | | | | | A number of fields were never being populated. Populate them as best we can. Add a new field, exited, to indicate whether the exit code has meaning (IE, the container has exited). Fix handling of running time - it stops ticking when the container stops. There is further work needed here, I suspect. Signed-off-by: Matthew Heon <mheon@redhat.com>
* Ignore running containers in ps exit-code filtersMatthew Heon2018-07-13
| | | | Signed-off-by: Matthew Heon <mheon@redhat.com>
* Record whether the container has exitedMatthew Heon2018-07-13
| | | | | | | | Use this to supplement exit codes returned from containers, to make sure we know when exit codes are invalid (as the container has not yet exited) Signed-off-by: Matthew Heon <mheon@redhat.com>
* Changed container status of Unknown from being printed as Dead to Error in Pshaircommander2018-07-12
| | | | | | | Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1083 Approved by: rhatdan
* Containers can dissappearDaniel J Walsh2018-06-26
| | | | | | | | | | | | Between the time that ps command gets the list of containers and is able to ask for more data, the container could have exited. This patch logs Clibpod.ErrNoSuchCtr errors and just continues processing. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #996 Approved by: mheon
* Added --sort to pshaircommander2018-06-19
| | | | | | | | | Also podman ps now allows user to only output size of root FS, changed language of images and ps --sort to be by "created" as opposed to "time", and refactored the way templates are created (converted from psJSONParams type). Signed-off-by: haircommander <pehunt@redhat.com> Closes: #948 Approved by: rhatdan
* Implement --latest for psMatthew Heon2018-06-14
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #944 Approved by: rhatdan
* Correctly report errors retrieving containers in psMatthew Heon2018-06-14
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #944 Approved by: rhatdan
* add podman container and image commandDaniel J Walsh2018-06-13
| | | | | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #941 Approved by: TomSweeneyRedHat
* sort containers and images by create timebaude2018-05-30
| | | | | | | | | | | | When running podman ps or podman images, the containers and images should be sorted by newest to oldest. Resolves: #830 Signed-off-by: baude <bbaude@redhat.com> Closes: #848 Approved by: mheon
* podman create, start, getattachsocketbaude2018-05-21
| | | | | | | | | First pass at implement API endpoints for create and start. Signed-off-by: baude <bbaude@redhat.com> Closes: #805 Approved by: baude