Merge pull request #734 from vmarmol/validate2
Add managed containers to debug output
This commit is contained in:
commit
a96f2f9325
@ -1136,5 +1136,36 @@ func (m *manager) DockerInfo() (DockerStatus, error) {
|
||||
}
|
||||
|
||||
func (m *manager) DebugInfo() map[string][]string {
|
||||
return container.DebugInfo()
|
||||
debugInfo := container.DebugInfo()
|
||||
|
||||
// Get unique containers.
|
||||
var conts map[*containerData]struct{}
|
||||
func() {
|
||||
m.containersLock.RLock()
|
||||
defer m.containersLock.RUnlock()
|
||||
|
||||
conts = make(map[*containerData]struct{}, len(m.containers))
|
||||
for _, c := range m.containers {
|
||||
conts[c] = struct{}{}
|
||||
}
|
||||
}()
|
||||
|
||||
// List containers.
|
||||
lines := make([]string, 0, len(conts))
|
||||
for cont := range conts {
|
||||
lines = append(lines, cont.info.Name)
|
||||
if cont.info.Namespace != "" {
|
||||
lines = append(lines, fmt.Sprintf("\tNamespace: %s", cont.info.Namespace))
|
||||
}
|
||||
|
||||
if len(cont.info.Aliases) != 0 {
|
||||
lines = append(lines, "\tAliases:")
|
||||
for _, alias := range cont.info.Aliases {
|
||||
lines = append(lines, fmt.Sprintf("\t\t%s", alias))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debugInfo["Managed containers"] = lines
|
||||
return debugInfo
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user