add ListServices method and ls CLI command

This commit is contained in:
Pavel Sviderski
2024-12-05 17:21:54 +10:00
parent 3ce9c8be04
commit 1fb8a3d7a0
8 changed files with 150 additions and 13 deletions
+3 -3
View File
@@ -32,13 +32,13 @@ func NewListCommand() *cobra.Command {
}
func runList(ctx context.Context, uncli *cli.CLI, clusterName string) error {
c, err := uncli.ConnectCluster(ctx, clusterName)
client, err := uncli.ConnectCluster(ctx, clusterName)
if err != nil {
return fmt.Errorf("connect to cluster: %w", err)
}
defer c.Close()
defer client.Close()
machines, err := c.ListMachines(ctx)
machines, err := client.ListMachines(ctx)
if err != nil {
return fmt.Errorf("list machines: %w", err)
}