Skip to content

Commit

Permalink
Fix: 'orchard proxy' wasn't picking up -H argument
Browse files Browse the repository at this point in the history
  • Loading branch information
aanand committed Feb 18, 2014
1 parent d377ba1 commit c7c249b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func RunRemoveHost(cmd *Command, args []string) error {
}

func RunDocker(cmd *Command, args []string) error {
return WithDockerProxy("", func(listenURL string) error {
return WithDockerProxy("", *flDockerHost, func(listenURL string) error {
err := CallDocker(args, []string{"DOCKER_HOST=" + listenURL})
if err != nil {
return fmt.Errorf("Docker exited with error")
Expand All @@ -287,7 +287,7 @@ func RunProxy(cmd *Command, args []string) error {
return cmd.UsageError("`orchard proxy` expects at most 1 argument, but got: %s", strings.Join(args, " "))
}

return WithDockerProxy(specifiedURL, func(listenURL string) error {
return WithDockerProxy(specifiedURL, *flProxyHost, func(listenURL string) error {
fmt.Fprintf(os.Stderr, "Started proxy at %s\n", listenURL)

c := make(chan os.Signal)
Expand All @@ -299,10 +299,9 @@ func RunProxy(cmd *Command, args []string) error {
})
}

func WithDockerProxy(listenURL string, callback func(string) error) error {
hostName := "default"
if *flDockerHost != "" {
hostName = *flDockerHost
func WithDockerProxy(listenURL, hostName string, callback func(string) error) error {
if hostName == "" {
hostName = "default"
}

if listenURL == "" {
Expand Down

0 comments on commit c7c249b

Please sign in to comment.