Add logging support for base condition in debug
Signed-off-by: Yann Ramin <atrus@stackworks.net>
This commit is contained in:
parent
a2fc41358a
commit
9a86dbabc2
1 changed files with 8 additions and 4 deletions
|
@ -42,21 +42,25 @@ func (s *Server) filterContainerList(filter *pb.ContainerFilter, origCtrList []*
|
|||
}
|
||||
c := s.ContainerServer.GetContainer(id)
|
||||
if c != nil {
|
||||
if filter.PodSandboxId == "" || c.Sandbox() == filter.PodSandboxId {
|
||||
switch {
|
||||
case filter.PodSandboxId == "":
|
||||
return []*oci.Container{c}
|
||||
case c.Sandbox() == filter.PodSandboxId:
|
||||
return []*oci.Container{c}
|
||||
default:
|
||||
return []*oci.Container{}
|
||||
}
|
||||
return []*oci.Container{c}
|
||||
}
|
||||
} else {
|
||||
if filter.PodSandboxId != "" {
|
||||
pod := s.ContainerServer.GetSandbox(filter.PodSandboxId)
|
||||
if pod == nil {
|
||||
return []*oci.Container{}
|
||||
} else {
|
||||
}
|
||||
return pod.Containers().List()
|
||||
}
|
||||
}
|
||||
}
|
||||
logrus.Debug("no filters were applied, returning full container list")
|
||||
return origCtrList
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue