Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
shim: Add ability to enable debug output
Browse files Browse the repository at this point in the history
Add a new option to `CCShimConfig` to allow `cc-shim` debug output
to be enabled.

Fixes #401.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Oct 6, 2017
1 parent 64ae83d commit df5e866
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cc_shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ type ccShim struct{}
// CCShimConfig is the structure providing specific configuration
// for ccShim implementation.
type CCShimConfig struct {
Path string
Path string
Debug bool
}

var consoleFileMode = os.FileMode(0660)
Expand Down Expand Up @@ -58,7 +59,12 @@ func (s *ccShim) start(pod Pod, params ShimParams) (int, error) {
return -1, fmt.Errorf("URL cannot be empty")
}

cmd := exec.Command(config.Path, "-t", params.Token, "-u", params.URL)
args := []string{config.Path, "-t", params.Token, "-u", params.URL}
if config.Debug {
args = append(args, "-d")
}

cmd := exec.Command(args[0], args[1:]...)
cmd.Env = os.Environ()

if !params.Detach {
Expand Down

0 comments on commit df5e866

Please sign in to comment.