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

shim: Add ability to enable debug output #402

Merged
merged 1 commit into from
Oct 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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