Skip to content

Commit

Permalink
Making output more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
jdewinne committed Aug 17, 2023
1 parent c6a7ffc commit c64534c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cli/cmd/cluster_prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ func (r *runners) prepareCluster(_ *cobra.Command, args []string) error {
clusterID := ""

if r.args.prepareClusterID == "" {
log.ChildActionWithoutSpinner("SEQUENCE: %d", release.Sequence)

if r.args.prepareClusterName == "" {
r.args.prepareClusterName = generateClusterName()
}
Expand Down Expand Up @@ -194,7 +192,7 @@ func (r *runners) prepareCluster(_ *cobra.Command, args []string) error {
fmt.Printf("Failed to wait for cluster %s to be ready: %v\n", cl.ID, err)
}

fmt.Fprintf(r.w, "Cluster %s (%s) created.\n", cl.Name, cl.ID)
log.ActionWithoutSpinner("Cluster %s (%s) created.\n", cl.Name, cl.ID)
}(&wg)
} else {
// need to get the cluster info to get the name to pass to the customer
Expand Down Expand Up @@ -253,15 +251,15 @@ func (r *runners) prepareCluster(_ *cobra.Command, args []string) error {
if appRelease.IsHelmOnly {
customerOpts.IsKotInstallEnabled = false
}
log.ActionWithSpinner("Creating Customer")
customer, err := r.api.CreateCustomer(r.appType, customerOpts)
if err != nil {
log.FinishSpinnerWithError()
return errors.Wrap(err, "failed to create customer")
}
log.FinishSpinner()

_, err = fmt.Fprintf(r.w, "Customer %s (%s) created.\n", customer.Name, customer.ID)
if err != nil {
return errors.Wrap(err, "failed to write to stdout")
}
log.ChildActionWithoutSpinner("Customer %s (%s) created.\n", customer.Name, customer.ID)

// wait for the wait group
wg.Wait()
Expand Down Expand Up @@ -335,6 +333,8 @@ func prepareRelease(r *runners, log *logger.Logger) (*types.ReleaseInfo, error)
}
log.FinishSpinner()

log.ChildActionWithoutSpinner("SEQUENCE: %d", release.Sequence)

return release, nil
}

Expand Down Expand Up @@ -583,7 +583,7 @@ func installHelmChart(r *runners, appSlug string, chartName string, releaseSeque

registryClient, err := registry.NewClient(
registry.ClientOptDebug(settings.Debug),
registry.ClientOptWriter(r.w),
registry.ClientOptWriter(io.Discard),
registry.ClientOptCredentialsFile(credentialsFile),
)
if err != nil {
Expand Down

0 comments on commit c64534c

Please sign in to comment.