fix: print service endpoints for run service only when non-empty

This commit is contained in:
Pavel Sviderski
2025-03-15 19:35:21 +10:00
parent 76129ea056
commit a0551d2d64
+7 -4
View File
@@ -148,10 +148,13 @@ func run(ctx context.Context, uncli *cli.CLI, opts runOptions) error {
return fmt.Errorf("inspect service: %w", err)
}
fmt.Println()
fmt.Printf("%s endpoints:\n", svc.Name)
for _, endpoint := range svc.Endpoints() {
fmt.Printf(" • %s\n", endpoint)
endpoints := svc.Endpoints()
if len(endpoints) > 0 {
fmt.Println()
fmt.Printf("%s endpoints:\n", svc.Name)
for _, endpoint := range endpoints {
fmt.Printf(" • %s\n", endpoint)
}
}
return nil