Skip to content

Commit a64c5fa

Browse files
committed
Merge pull request #4376 from mboersma/new-router-cleanup
style(builder): incorporate remaining code comments
2 parents 2e46268 + ca35e52 commit a64c5fa

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

builder/docker/docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ var DockSock = "/var/run/docker.sock"
3030
// Returns true if the file exists (and was deleted), or false if no file
3131
// was deleted.
3232
func Cleanup(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
33-
3433
// If info is returned, then the file is there. If we get an error, we're
3534
// pretty much not going to be able to remove the file (which probably
3635
// doesn't exist).
@@ -61,6 +60,7 @@ func CreateClient(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Inter
6160
// This assumes the presence of the docker client on the host. It does not use
6261
// the API.
6362
func Start(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
63+
// Allow insecure Docker registries on all private network ranges in RFC 1918 and RFC 6598.
6464
dargs := []string{
6565
"-d",
6666
"--bip=172.19.42.1/16",

builder/etcd/etcd.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/Masterminds/cookoo"
1616
"github.com/Masterminds/cookoo/log"
1717
"github.com/Masterminds/cookoo/safely"
18-
1918
"github.com/coreos/go-etcd/etcd"
2019
)
2120

@@ -327,7 +326,6 @@ func genSSHKeys(c cookoo.Context) error {
327326
// - client (Setter): The client to use to write the data to etcd.
328327
// - sshPid (int): The PID for SSHD. If SSHD dies, this stops notifying.
329328
func UpdateHostPort(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
330-
331329
base := p.Get("base", "").(string)
332330
host := p.Get("host", "").(string)
333331
port := p.Get("port", "").(string)
@@ -405,7 +403,6 @@ func MakeDir(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
405403
}
406404

407405
return res, nil
408-
409406
}
410407

411408
// Watch watches a given path, and executes a git check-repos for each event.
@@ -511,7 +508,6 @@ func Watch(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
511508
//
512509
// It adds configurable number of retries and configurable timesouts.
513510
func checkRetry(c *etcd.Cluster, numReqs int, last http.Response, err error) error {
514-
515511
if numReqs > retryCycles*len(c.Machines) {
516512
return fmt.Errorf("Tried and failed %d cluster connections: %s", retryCycles, err)
517513
}

builder/rootfs/usr/local/src/slugrunner/runner/init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mkdir -p .profile.d
2828

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

3333
if [[ -s .release ]]; then
3434
ruby -e "require 'yaml';(YAML.load_file('.release')['config_vars'] || {}).each{|k,v| puts \"#{k}='#{v}'\"}" > .profile.d/config_vars

builder/sshd/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (s *server) answer(channel ssh.Channel, requests <-chan *ssh.Request, sshCo
207207

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

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

0 commit comments

Comments
 (0)