Skip to content

Commit

Permalink
merge(#304): feat(cl/np/delete): added response-based info msg
Browse files Browse the repository at this point in the history
feat(cl/np/delete): added response-based info msg
  • Loading branch information
pregnor authored Sep 17, 2020
2 parents a380b69 + 46ced09 commit 9cf6d29
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/cli/command/cluster/nodepool/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ package nodepool

import (
"context"
"fmt"
"net/http"

"emperror.dev/errors"
"github.com/banzaicloud/banzai-cli/internal/cli"
Expand Down Expand Up @@ -82,5 +84,12 @@ func deleteNodePool(banzaiCli cli.Cli, options deleteOptions, args []string) err
return err
}

switch resp.StatusCode {
case http.StatusAccepted:
_, _ = fmt.Fprintf(banzaiCli.Out(), "delete process initiated for node pool '%s'\n", nodePoolName)
case http.StatusNoContent:
_, _ = fmt.Fprintf(banzaiCli.Out(), "node pool '%s' does not exist, nothing to do\n", nodePoolName)
}

return nil
}

0 comments on commit 9cf6d29

Please sign in to comment.