Skip to content

Commit

Permalink
fix: split cluster delete log to different levels
Browse files Browse the repository at this point in the history
- set the log level of the http response to debug
- set the log level of the action info message to info
- change misleading variable name holding the http response object
  • Loading branch information
akijakya committed Nov 4, 2021
1 parent da21a21 commit c2c7397
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/cli/command/cluster/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ func runDelete(banzaiCli cli.Cli, options deleteOptions, args []string) error {
return errors.New("deletion cancelled")
}
}
if cluster, err := client.ClustersApi.DeleteCluster(context.Background(), orgId, id, &pipeline.DeleteClusterOpts{Force: optional.NewBool(options.force)}); err != nil {
if resp, err := client.ClustersApi.DeleteCluster(context.Background(), orgId, id, &pipeline.DeleteClusterOpts{Force: optional.NewBool(options.force)}); err != nil {
cli.LogAPIError("delete cluster", err, id)
return errors.WrapIf(err, "failed to delete cluster")
} else {
log.Printf("Deleting cluster %v", cluster)
log.Info("deleting cluster")
log.Debug(resp)
}
if cluster, _, err := client.ClustersApi.GetCluster(context.Background(), orgId, id); err != nil {
cli.LogAPIError("get cluster", err, id)
Expand Down

0 comments on commit c2c7397

Please sign in to comment.