Skip to content

Commit

Permalink
Remove code and description from GRCP errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dinesh committed Apr 21, 2018
1 parent bc2743f commit 7aa46ed
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [UNRELEASED] - 0000-00-00
### Fixes
- [CLI] Remove code and description from GRCP errors
- [API] Skipping ephemeral pods while log streaming
- [CLI] `ps` should list recent pods with tabular format (Added cpu, memory fields)
- [API] Don't stream logs from crashed/failed pods
Expand Down
7 changes: 6 additions & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ func cmdAppRun(c *cli.Context) error {

func prepareCommand(c *cli.Context) []string {
args := c.Args()

return append([]string{"env", fmt.Sprintf("TERM=%s", getTermEnv())}, args...)
}

func getTermEnv() string {
term := os.Getenv("TERM")
if term == "" {
term = "xterm"
}

return append([]string{"env", fmt.Sprintf("TERM=%s", term)}, args...)
return term
}
4 changes: 4 additions & 0 deletions cmd/stdcli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
pb "github.com/datacol-io/datacol/api/models"
rollbarAPI "github.com/stvp/rollbar"
"github.com/urfave/cli"
"google.golang.org/grpc/status"
)

var (
Expand Down Expand Up @@ -137,6 +138,9 @@ func CheckFlagsPresence(c *cli.Context, flags ...string) {

func ExitOnError(err error) {
if err != nil {
if gerr, ok := status.FromError(err); ok {
term.Fatalln(gerr.Message())
}
term.Fatalln(err)
}
}
Expand Down
2 changes: 2 additions & 0 deletions k8s/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ func ProcessList(c *kubernetes.Clientset, ns, app string) ([]*pb.Process, error)
return nil, err
}

log.Debugf("got %d pods for %s", len(pods), app)

if len(pods) == 0 {
continue
}
Expand Down

0 comments on commit 7aa46ed

Please sign in to comment.