Browse Source

allow filtering containers by any status

Signed-off-by: Kamil Domański <kamil@domanski.co>
(cherry picked from commit 9ada6a06c57ce4ed4bfad50f603962b7b9ce6fb1)
Kamil Domański 9 years ago
parent
commit
f30364c583
2 changed files with 3 additions and 4 deletions
  1. 2 3
      daemon/list.go
  2. 1 1
      docs/reference/api/docker_remote_api_v1.22.md

+ 2 - 3
daemon/list.go

@@ -150,9 +150,8 @@ func (daemon *Daemon) foldFilter(config *ContainersConfig) (*listContext, error)
 			if !isValidStateString(value) {
 			if !isValidStateString(value) {
 				return nil, errors.New("Unrecognised filter value for status")
 				return nil, errors.New("Unrecognised filter value for status")
 			}
 			}
-			if value == "exited" || value == "created" {
-				config.All = true
-			}
+
+			config.All = true
 		}
 		}
 	}
 	}
 
 

+ 1 - 1
docs/reference/api/docker_remote_api_v1.22.md

@@ -114,7 +114,7 @@ Query Parameters:
         sizes
         sizes
 -   **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters:
 -   **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters:
   -   `exited=<int>`; -- containers with exit code of  `<int>` ;
   -   `exited=<int>`; -- containers with exit code of  `<int>` ;
-  -   `status=`(`created`|`restarting`|`running`|`paused`|`exited`)
+  -   `status=`(`created`|`restarting`|`running`|`paused`|`exited`|`dead`)
   -   `label=key` or `label="key=value"` of a container label
   -   `label=key` or `label="key=value"` of a container label
   -   `isolation=`(`default`|`process`|`hyperv`)   (Windows daemon only)
   -   `isolation=`(`default`|`process`|`hyperv`)   (Windows daemon only)