diff --git a/cmd/query_lambda.go b/cmd/query_lambda.go index 30fdc9c..9e6bc31 100644 --- a/cmd/query_lambda.go +++ b/cmd/query_lambda.go @@ -245,14 +245,13 @@ func newCreateQueryLambdaCmd() *cobra.Command { if err != nil { return err } + _, _ = fmt.Fprintf(cmd.OutOrStdout(), "created query lambda %s.%s:%s\n", + ql.GetWorkspace(), ql.GetName(), ql.GetVersion()) if err = waitUntilQLActive(rs, cmd, ws, args[0], ql.GetVersion()); err != nil { return err } - _, _ = fmt.Fprintf(cmd.OutOrStdout(), "created query lambda %s.%s:%s\n", - ql.GetWorkspace(), ql.GetName(), ql.GetVersion()) - return nil }, } @@ -337,14 +336,13 @@ func newUpdateQueryLambdaCmd() *cobra.Command { if err != nil { return err } + _, _ = fmt.Fprintf(cmd.OutOrStdout(), "updated query lambda %s.%s:%s", + ql.GetWorkspace(), ql.GetName(), ql.GetVersion()) if err = waitUntilQLActive(rs, cmd, ws, args[0], ql.GetVersion()); err != nil { return err } - _, _ = fmt.Fprintf(cmd.OutOrStdout(), "updated query lambda %s.%s:%s", - ql.GetWorkspace(), ql.GetName(), ql.GetVersion()) - return nil }, } @@ -367,7 +365,7 @@ func waitUntilQLActive(rs *rockset.RockClient, cmd *cobra.Command, ws, name, ver return err } if wait { - // TODO notify the user that we're waiting + _, _ = fmt.Fprintf(cmd.OutOrStdout(), "waiting until query lambda is ready...") if err := rs.Wait.UntilQueryLambdaVersionActive(cmd.Context(), ws, name, version); err != nil { return fmt.Errorf("failed to wait for %s.%s:%s to be active: %v", ws, name, version, err) } diff --git a/cmd/virtual_instance.go b/cmd/virtual_instance.go index 6c5afc7..73d2402 100644 --- a/cmd/virtual_instance.go +++ b/cmd/virtual_instance.go @@ -48,12 +48,12 @@ func newCreateVirtualInstanceCmd() *cobra.Command { if err != nil { return err } + _, _ = fmt.Fprintf(cmd.OutOrStdout(), "virtual instance '%s' created\n", result.GetName()) if err = waitUntilVIActive(rs, cmd, result.GetId()); err != nil { return err } - _, _ = fmt.Fprintf(cmd.OutOrStdout(), "virtual instance '%s' created\n", result.GetName()) return nil }, } @@ -100,12 +100,12 @@ func newUpdateVirtualInstanceCmd() *cobra.Command { if err != nil { return err } + _, _ = fmt.Fprintf(cmd.OutOrStdout(), "virtual instance '%s' updated\n", result.GetName()) if err = waitUntilVIActive(rs, cmd, result.GetId()); err != nil { return err } - _, _ = fmt.Fprintf(cmd.OutOrStdout(), "virtual instance '%s' updated\n", result.GetName()) return nil }, } @@ -291,13 +291,12 @@ func newResumeVirtualInstanceCmd() *cobra.Command { if err != nil { return err } + _, _ = fmt.Fprintf(cmd.OutOrStdout(), "virtual instance '%s' resumed\n", result.GetName()) if err = waitUntilVIActive(rs, cmd, id); err != nil { return err } - _, _ = fmt.Fprintf(cmd.OutOrStdout(), "virtual instance '%s' resumed\n", result.GetName()) - return nil }, } @@ -350,7 +349,8 @@ func waitUntilVIActive(rs *rockset.RockClient, cmd *cobra.Command, vID string) e return err } if wait { - // TODO notify the user that we're waiting + _, _ = fmt.Fprintf(cmd.OutOrStdout(), "waiting for virtual instance to be ready...\n") + if err := rs.Wait.UntilVirtualInstanceActive(cmd.Context(), vID); err != nil { return fmt.Errorf("failed to wait for %s to be active: %v", vID, err) }