mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
feat: print service endpoints on service creation
This commit is contained in:
@@ -109,9 +109,21 @@ func run(ctx context.Context, uncli *cli.CLI, opts runOptions) error {
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
if _, err = client.RunService(ctx, spec); err != nil {
|
||||
resp, err := client.RunService(ctx, spec)
|
||||
if err != nil {
|
||||
return fmt.Errorf("run service: %w", err)
|
||||
}
|
||||
|
||||
svc, err := client.InspectService(ctx, resp.ID)
|
||||
if err != nil {
|
||||
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)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user