Skip to content

Commit

Permalink
Merge pull request deis#4376 from mboersma/new-router-cleanup
Browse files Browse the repository at this point in the history
style(builder): incorporate remaining code comments
  • Loading branch information
mboersma committed Sep 4, 2015
2 parents 2e46268 + ca35e52 commit a64c5fa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion builder/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ var DockSock = "/var/run/docker.sock"
// Returns true if the file exists (and was deleted), or false if no file
// was deleted.
func Cleanup(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {

// If info is returned, then the file is there. If we get an error, we're
// pretty much not going to be able to remove the file (which probably
// doesn't exist).
Expand Down Expand Up @@ -61,6 +60,7 @@ func CreateClient(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Inter
// This assumes the presence of the docker client on the host. It does not use
// the API.
func Start(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
// Allow insecure Docker registries on all private network ranges in RFC 1918 and RFC 6598.
dargs := []string{
"-d",
"--bip=172.19.42.1/16",
Expand Down
4 changes: 0 additions & 4 deletions builder/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/Masterminds/cookoo"
"github.com/Masterminds/cookoo/log"
"github.com/Masterminds/cookoo/safely"

"github.com/coreos/go-etcd/etcd"
)

Expand Down Expand Up @@ -327,7 +326,6 @@ func genSSHKeys(c cookoo.Context) error {
// - client (Setter): The client to use to write the data to etcd.
// - sshPid (int): The PID for SSHD. If SSHD dies, this stops notifying.
func UpdateHostPort(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {

base := p.Get("base", "").(string)
host := p.Get("host", "").(string)
port := p.Get("port", "").(string)
Expand Down Expand Up @@ -405,7 +403,6 @@ func MakeDir(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
}

return res, nil

}

// Watch watches a given path, and executes a git check-repos for each event.
Expand Down Expand Up @@ -511,7 +508,6 @@ func Watch(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
//
// It adds configurable number of retries and configurable timesouts.
func checkRetry(c *etcd.Cluster, numReqs int, last http.Response, err error) error {

if numReqs > retryCycles*len(c.Machines) {
return fmt.Errorf("Tried and failed %d cluster connections: %s", retryCycles, err)
}
Expand Down
2 changes: 1 addition & 1 deletion builder/rootfs/usr/local/src/slugrunner/runner/init
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mkdir -p .profile.d

# If a file is created in slugbuilder with the wrong UID, change it. But we
# don't mess with anything owned by UID 0.
find . -user 1000 -exec chown 2000:2000 {} \;
find . -user 1000 -exec chown slug:slug {} \;

if [[ -s .release ]]; then
ruby -e "require 'yaml';(YAML.load_file('.release')['config_vars'] || {}).each{|k,v| puts \"#{k}='#{v}'\"}" > .profile.d/config_vars
Expand Down
4 changes: 2 additions & 2 deletions builder/sshd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (s *server) answer(channel ssh.Channel, requests <-chan *ssh.Request, sshCo

router := s.c.Get("cookoo.Router", nil).(*cookoo.Router)

// XXX: Should we unset the context value 'cookoo.Router'?
// TODO: Should we unset the context value 'cookoo.Router'?
// We need a shallow copy of the context to avoid race conditions.
cxt := s.c.Copy()
cxt.Put("SSH_CONNECTION", sshConn)
Expand Down Expand Up @@ -285,7 +285,7 @@ type GenericMessage struct {
func cleanExec(pay []byte) string {
e := &ExecCmd{}
ssh.Unmarshal(pay, e)
// XXX: Minimal escaping of values in command. There is probably a better
// TODO: Minimal escaping of values in command. There is probably a better
// way of doing this.
r := strings.NewReplacer("$", "", "`", "'")
return r.Replace(e.Value)
Expand Down

0 comments on commit a64c5fa

Please sign in to comment.