| 753 | } |
| 754 | |
| 755 | func (m *manager) DebugInfo() map[string][]string { |
| 756 | debugInfo := container.DebugInfo() |
| 757 | |
| 758 | // Get unique containers. |
| 759 | conts := make(map[*containerData]struct{}) |
| 760 | m.containers.Range(func(_ namespacedContainerName, cont *containerData) bool { |
| 761 | if cont != nil { |
| 762 | conts[cont] = struct{}{} |
| 763 | } |
| 764 | return true |
| 765 | }) |
| 766 | |
| 767 | // List containers. |
| 768 | lines := make([]string, 0, len(conts)) |
| 769 | for cont := range conts { |
| 770 | lines = append(lines, cont.info.Name) |
| 771 | if cont.info.Namespace != "" { |
| 772 | lines = append(lines, fmt.Sprintf("\tNamespace: %s", cont.info.Namespace)) |
| 773 | } |
| 774 | |
| 775 | if len(cont.info.Aliases) != 0 { |
| 776 | lines = append(lines, "\tAliases:") |
| 777 | for _, alias := range cont.info.Aliases { |
| 778 | lines = append(lines, fmt.Sprintf("\t\t%s", alias)) |
| 779 | } |
| 780 | } |
| 781 | } |
| 782 | |
| 783 | debugInfo["Managed containers"] = lines |
| 784 | return debugInfo |
| 785 | } |
| 786 | |
| 787 | func (m *manager) GetVersionInfo() (*info.VersionInfo, error) { |
| 788 | // TODO: Consider caching this and periodically updating. The VersionInfo may change if |