Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

unmanaged-cluster: add line break after error output #2839

Merged
merged 1 commit into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/cmd/plugin/unmanaged-cluster/cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func configure(cmd *cobra.Command, args []string) error {

err = config.RenderConfigToFile(fileName, scConfig)
if err != nil {
log.Errorf("Failed to write configuration file: %s", err.Error())
log.Errorf("Failed to write configuration file: %s\n", err.Error())
return nil
}
log.Infof("Wrote configuration file to: %s\n", fileName)
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/plugin/unmanaged-cluster/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func create(cmd *cobra.Command, args []string) error {
tm := tanzu.New(log)
err = tm.Deploy(clusterConfig)
if err != nil {
log.Error(err.Error())
log.Errorf("%s\n", err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative here would be to change the log.Error method to:

+ fmt.Println(message)
- fmt.Print(message)

but I'm also good with your change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's revisit this option as an enhancement to the log package.

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/plugin/unmanaged-cluster/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func list(cmd *cobra.Command, args []string) error {
tClient := tanzu.New(log)
clusters, err := tClient.List()
if err != nil {
return fmt.Errorf("unable to list clusters. Error: %s", err.Error())
return fmt.Errorf("unable to list clusters. Error: %s\n", err.Error())
stmcginnis marked this conversation as resolved.
Show resolved Hide resolved
}

t := component.NewOutputWriter(cmd.OutOrStdout(), "table", "NAME", "PROVIDER")
Expand Down