Windows: Add isolation to ps filter

Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 9c5814171ce7ab3af48867da36f4d374f804c4a6
Component: engine
This commit is contained in:
John Howard
2015-11-05 10:18:24 -08:00
parent 03bd2aa8e5
commit 2ba09b4e09
6 changed files with 33 additions and 0 deletions
+5
View File
@@ -234,6 +234,11 @@ func includeContainerInList(container *Container, ctx *listContext) iterationAct
return excludeContainer
}
// Do not include container if the isolation mode doesn't match
if excludeContainer == excludeByIsolation(container, ctx) {
return excludeContainer
}
// Do not include container if it's in the list before the filter container.
// Set the filter container to nil to include the rest of containers after this one.
if ctx.beforeContainer != nil {
+9
View File
@@ -0,0 +1,9 @@
// +build linux freebsd
package daemon
// excludeByIsolation is a platform specific helper function to support PS
// filtering by Isolation. This is a Windows-only concept, so is a no-op on Unix.
func excludeByIsolation(container *Container, ctx *listContext) iterationAction {
return includeContainer
}
+16
View File
@@ -0,0 +1,16 @@
package daemon
import "strings"
// excludeByIsolation is a platform specific helper function to support PS
// filtering by Isolation. This is a Windows-only concept, so is a no-op on Unix.
func excludeByIsolation(container *Container, ctx *listContext) iterationAction {
i := strings.ToLower(string(container.hostConfig.Isolation))
if i == "" {
i = "default"
}
if !ctx.filters.Match("isolation", i) {
return excludeContainer
}
return includeContainer
}