Skip to content

Commit

Permalink
Merge pull request #18798 from edsantiago/fix_filters
Browse files Browse the repository at this point in the history
filters: better handling of id=
  • Loading branch information
openshift-merge-robot authored Jun 7, 2023
2 parents 384e937 + 992093a commit c99d42b
Show file tree
Hide file tree
Showing 14 changed files with 327 additions and 133 deletions.
2 changes: 1 addition & 1 deletion cmd/podman/pods/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func sortPodPsOutput(sortBy string, lprs []*entities.ListPodsReport) error {
case "status":
sort.Sort(podPsSortedStatus{lprs})
default:
return errors.New("invalid option for --sort, options are: id, names, or number")
return errors.New("invalid option for --sort, options are: created, id, name, number, or status")
}
return nil
}
Expand Down
28 changes: 14 additions & 14 deletions docs/source/markdown/podman-pause.1.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ Filters with the same key work inclusive with the only exception being

Valid filters are listed below:

| **Filter** | **Description** |
| --------------- | -------------------------------------------------------------------------------- |
| id | [ID] Container's ID (accepts regex) |
| name | [Name] Container's name (accepts regex) |
| label | [Key] or [Key=Value] Label assigned to a container |
| exited | [Int] Container's exit code |
| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' |
| ancestor | [ImageName] Image or descendant used to create container |
| before | [ID] or [Name] Containers created before this container |
| since | [ID] or [Name] Containers created since this container |
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
| health | [Status] healthy or unhealthy |
| pod | [Pod] name or full or partial ID of pod |
| network | [Network] name or full ID of network |
| **Filter** | **Description** |
|------------|----------------------------------------------------------------------------------|
| id | [ID] Container's ID (CID prefix match by default; accepts regex) |
| name | [Name] Container's name (accepts regex) |
| label | [Key] or [Key=Value] Label assigned to a container |
| exited | [Int] Container's exit code |
| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' |
| ancestor | [ImageName] Image or descendant used to create container |
| before | [ID] or [Name] Containers created before this container |
| since | [ID] or [Name] Containers created since this container |
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
| health | [Status] healthy or unhealthy |
| pod | [Pod] name or full or partial ID of pod |
| network | [Network] name or full ID of network |

@@option latest

Expand Down
24 changes: 12 additions & 12 deletions docs/source/markdown/podman-pod-ps.1.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ The *filters* argument format is of `key=value`. If there is more than one *filt

Supported filters:

| Filter | Description |
| ---------- | -------------------------------------------------------------------------------------------------- |
| *ctr-ids* | Filter by container ID within the pod. |
| *ctr-names* | Filter by container name within the pod. |
| *ctr-number*| Filter by number of containers in the pod. |
| *ctr-status*| Filter by container status within the pod. |
| *id* | Filter by pod ID. |
| *label* | Filter by container with (or without, in the case of label!=[...] is used) the specified labels. |
| *name* | Filter by pod name. |
| *network* | Filter by network name or full ID of network. |
| *status* | Filter by pod status. |
| *until* | Filter by pods created before given timestamp. |
| Filter | Description |
|--------------|--------------------------------------------------------------------------------------------------|
| *ctr-ids* | Filter by container ID within the pod. (CID prefix match by default; accepts regex) |
| *ctr-names* | Filter by container name within the pod. |
| *ctr-number* | Filter by number of containers in the pod. |
| *ctr-status* | Filter by container status within the pod. |
| *id* | Filter by pod ID. (Prefix match by default; accepts regex) |
| *label* | Filter by container with (or without, in the case of label!=[...] is used) the specified labels. |
| *name* | Filter by pod name. |
| *network* | Filter by network name or full ID of network. |
| *status* | Filter by pod status. |
| *until* | Filter by pods created before given timestamp. |

The `ctr-ids`, `ctr-names`, `id`, `name` filters accept `regex` format.

Expand Down
28 changes: 14 additions & 14 deletions docs/source/markdown/podman-ps.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ Filters with the same key work inclusive with the only exception being

Valid filters are listed below:

| **Filter** | **Description** |
| --------------- | -------------------------------------------------------------------------------- |
| id | [ID] Container's ID (accepts regex) |
| name | [Name] Container's name (accepts regex) |
| label | [Key] or [Key=Value] Label assigned to a container |
| exited | [Int] Container's exit code |
| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' |
| ancestor | [ImageName] Image or descendant used to create container (accepts regex) |
| before | [ID] or [Name] Containers created before this container |
| since | [ID] or [Name] Containers created since this container |
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
| health | [Status] healthy or unhealthy |
| pod | [Pod] name or full or partial ID of pod |
| network | [Network] name or full ID of network |
| **Filter** | **Description** |
|------------|----------------------------------------------------------------------------------|
| id | [ID] Container's ID (CID prefix match by default; accepts regex) |
| name | [Name] Container's name (accepts regex) |
| label | [Key] or [Key=Value] Label assigned to a container |
| exited | [Int] Container's exit code |
| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' |
| ancestor | [ImageName] Image or descendant used to create container (accepts regex) |
| before | [ID] or [Name] Containers created before this container |
| since | [ID] or [Name] Containers created since this container |
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
| health | [Status] healthy or unhealthy |
| pod | [Pod] name or full or partial ID of pod |
| network | [Network] name or full ID of network |


#### **--format**=*format*
Expand Down
28 changes: 14 additions & 14 deletions docs/source/markdown/podman-restart.1.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ Filters with the same key work inclusive with the only exception being

Valid filters are listed below:

| **Filter** | **Description** |
| --------------- | -------------------------------------------------------------------------------- |
| id | [ID] Container's ID (accepts regex) |
| name | [Name] Container's name (accepts regex) |
| label | [Key] or [Key=Value] Label assigned to a container |
| exited | [Int] Container's exit code |
| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' |
| ancestor | [ImageName] Image or descendant used to create container |
| before | [ID] or [Name] Containers created before this container |
| since | [ID] or [Name] Containers created since this container |
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
| health | [Status] healthy or unhealthy |
| pod | [Pod] name or full or partial ID of pod |
| network | [Network] name or full ID of network |
| **Filter** | **Description** |
|------------|----------------------------------------------------------------------------------|
| id | [ID] Container's ID (CID prefix match by default; accepts regex) |
| name | [Name] Container's name (accepts regex) |
| label | [Key] or [Key=Value] Label assigned to a container |
| exited | [Int] Container's exit code |
| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' |
| ancestor | [ImageName] Image or descendant used to create container |
| before | [ID] or [Name] Containers created before this container |
| since | [ID] or [Name] Containers created since this container |
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
| health | [Status] healthy or unhealthy |
| pod | [Pod] name or full or partial ID of pod |
| network | [Network] name or full ID of network |

@@option latest

Expand Down
28 changes: 14 additions & 14 deletions docs/source/markdown/podman-rm.1.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ Filters with the same key work inclusive with the only exception being

Valid filters are listed below:

| **Filter** | **Description** |
| --------------- | -------------------------------------------------------------------------------- |
| id | [ID] Container's ID (accepts regex) |
| name | [Name] Container's name (accepts regex) |
| label | [Key] or [Key=Value] Label assigned to a container |
| exited | [Int] Container's exit code |
| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' |
| ancestor | [ImageName] Image or descendant used to create container |
| before | [ID] or [Name] Containers created before this container |
| since | [ID] or [Name] Containers created since this container |
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
| health | [Status] healthy or unhealthy |
| pod | [Pod] name or full or partial ID of pod |
| network | [Network] name or full ID of network |
| **Filter** | **Description** |
|------------|----------------------------------------------------------------------------------|
| id | [ID] Container's ID (CID prefix match by default; accepts regex) |
| name | [Name] Container's name (accepts regex) |
| label | [Key] or [Key=Value] Label assigned to a container |
| exited | [Int] Container's exit code |
| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' |
| ancestor | [ImageName] Image or descendant used to create container |
| before | [ID] or [Name] Containers created before this container |
| since | [ID] or [Name] Containers created since this container |
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
| health | [Status] healthy or unhealthy |
| pod | [Pod] name or full or partial ID of pod |
| network | [Network] name or full ID of network |

#### **--force**, **-f**

Expand Down
28 changes: 14 additions & 14 deletions docs/source/markdown/podman-start.1.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ Filters with the same key work inclusive with the only exception being

Valid filters are listed below:

| **Filter** | **Description** |
| --------------- | -------------------------------------------------------------------------------- |
| id | [ID] Container's ID (accepts regex) |
| name | [Name] Container's name (accepts regex) |
| label | [Key] or [Key=Value] Label assigned to a container |
| exited | [Int] Container's exit code |
| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' |
| ancestor | [ImageName] Image or descendant used to create container |
| before | [ID] or [Name] Containers created before this container |
| since | [ID] or [Name] Containers created since this container |
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
| health | [Status] healthy or unhealthy |
| pod | [Pod] name or full or partial ID of pod |
| network | [Network] name or full ID of network |
| **Filter** | **Description** |
|------------|----------------------------------------------------------------------------------|
| id | [ID] Container's ID (CID prefix match by default; accepts regex) |
| name | [Name] Container's name (accepts regex) |
| label | [Key] or [Key=Value] Label assigned to a container |
| exited | [Int] Container's exit code |
| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' |
| ancestor | [ImageName] Image or descendant used to create container |
| before | [ID] or [Name] Containers created before this container |
| since | [ID] or [Name] Containers created since this container |
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
| health | [Status] healthy or unhealthy |
| pod | [Pod] name or full or partial ID of pod |
| network | [Network] name or full ID of network |

@@option interactive

Expand Down
Loading

0 comments on commit c99d42b

Please sign in to comment.