Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rade committed Aug 28, 2015
1 parent 6b5f35e commit 24de98e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions proxy/create_exec_interceptor.go
Expand Up @@ -31,21 +31,21 @@ func (i *createExecInterceptor) InterceptRequest(r *http.Request) error {
return err
}

_, hasWeaveWait := container.Volumes["/w"]
if _, hasWeaveWait := container.Volumes["/w"]; !hasWeaveWait {
return nil
}

cidrs, err := i.proxy.weaveCIDRsFromConfig(container.Config, container.HostConfig)
if err != nil {
Info.Printf("Ignoring container %s due to %s", container.ID, err)
} else if hasWeaveWait {
Info.Printf("Exec in container %s with WEAVE_CIDR \"%s\"", container.ID, strings.Join(cidrs, " "))
cmd := append(weaveWaitEntrypoint, "-s")
options.Cmd = append(cmd, options.Cmd...)

if err := marshalRequestBody(r, options); err != nil {
return err
}
return nil
}

return nil
Info.Printf("Exec in container %s with WEAVE_CIDR \"%s\"", container.ID, strings.Join(cidrs, " "))
cmd := append(weaveWaitEntrypoint, "-s")
options.Cmd = append(cmd, options.Cmd...)

return marshalRequestBody(r, options)
}

func (i *createExecInterceptor) InterceptResponse(r *http.Response) error {
Expand Down

2 comments on commit 24de98e

@paulbellamy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had looked at doing this, But was trying to keep the changeset smaller for merging to master.

@rade
Copy link
Member Author

@rade rade commented on 24de98e Aug 28, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

master doesn't look all that different.

Please sign in to comment.