Skip to content

Commit

Permalink
Merge pull request #12 from Dalee/small-refactor
Browse files Browse the repository at this point in the history
display errors of kubectl calls
  • Loading branch information
arkady-emelyanov authored Sep 28, 2017
2 parents 2ac97ad + 7b07124 commit 5ca8120
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ language: go
go:
- "1.8.x"

go_import_path: fuse

cache:
directories:
- vendor
Expand Down
2 changes: 1 addition & 1 deletion bin/cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"errors"
"fmt"
"fuse/pkg/kubectl"
"github.com/Dalee/fuse/pkg/kubectl"
"github.com/spf13/cobra"
"os"
"time"
Expand Down
2 changes: 1 addition & 1 deletion bin/cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"errors"
"fmt"
"fuse/pkg/kubectl"
"github.com/Dalee/fuse/pkg/kubectl"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions bin/cmd/garbage-collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"fmt"

"fuse/pkg/kubectl"
"fuse/pkg/reference"
"github.com/Dalee/fuse/pkg/kubectl"
"github.com/Dalee/fuse/pkg/reference"

"github.com/Dalee/hitman/pkg/registry"
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion bin/cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"fuse/pkg/kubectl"
"github.com/Dalee/fuse/pkg/kubectl"
"github.com/spf13/cobra"
"os"
)
Expand Down
2 changes: 1 addition & 1 deletion bin/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"fuse/bin/cmd"
"github.com/Dalee/fuse/bin/cmd"
"os"
)

Expand Down
8 changes: 4 additions & 4 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package: fuse
package: github.com/Dalee/fuse
import:
- package: github.com/ghodss/yaml
- package: github.com/spf13/cobra
Expand Down
6 changes: 3 additions & 3 deletions pkg/kubectl/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ func (c *kubeCommand) Run() ([]byte, bool) {
fmt.Printf("===> %s\n", strings.Join(c.getCommand().Args, " ")) // TODO: should be moved to logging

result, err := c.getCommand().CombinedOutput()
if err != nil {
return []byte("Command failed to run"), false
if len(result) == 0 {
result = []byte("Command failed to run")
}

return result, c.cmd.ProcessState.Success()
return result, err == nil
}

// Command getter
Expand Down

0 comments on commit 5ca8120

Please sign in to comment.