mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
feat: print service endpoints on service creation
This commit is contained in:
1 parent
4c239ed79a
commit
58ecc17ac1
2 files changed
+59
-1
No files matched your search
@@ -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