feat: show IMAGE column when listing services (uc ls) #13

This commit is contained in:
Pasha Sviderski
2025-09-22 14:03:45 +10:00
parent b6b8286118
commit 60926f64cc
2 changed files with 14 additions and 4 deletions
+9
View File
@@ -346,6 +346,15 @@ type MachineServiceContainer struct {
Container ServiceContainer
}
// Images returns a sorted list of unique images used by the service containers.
func (s *Service) Images() []string {
images := make(map[string]struct{})
for _, ctr := range s.Containers {
images[ctr.Container.Config.Image] = struct{}{}
}
return slices.Sorted(maps.Keys(images))
}
// Endpoints returns the exposed HTTP and HTTPS endpoints of the service.
func (s *Service) Endpoints() []string {
endpoints := make(map[string]struct{})