Skip to content

Commit 3daf28d

Browse files
committed
ref(builder): remove etcd and confd
1 parent 4689571 commit 3daf28d

28 files changed

Lines changed: 213 additions & 1548 deletions

glide.lock

Lines changed: 34 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ ignore:
66
- appengine/user
77
import:
88
- package: github.com/kelseyhightower/envconfig
9-
- package: github.com/coreos/go-etcd
10-
version: c904d7032a70da6551c43929f199244f6a45f4c1
11-
subpackages:
12-
- /etcd
139
- package: github.com/gorilla/mux
1410
version: e444e69cbd2e2e3e0749a2f3c717cec491552bbf
1511
- package: github.com/Masterminds/cookoo

pkg/commands.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,12 @@ package pkg
33
import (
44
"os"
55
"os/signal"
6-
"time"
76

87
"github.com/Masterminds/cookoo"
98
"github.com/Masterminds/cookoo/log"
109
"github.com/Masterminds/cookoo/safely"
1110
)
1211

13-
// Sleep delays the execution of the remainder of the chain of commands.
14-
//
15-
// Params:
16-
// -duration (time.Duration): Time to sleep.
17-
// -message (string): The message to log when entering sleep.
18-
func Sleep(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
19-
dur := p.Get("duration", 10*time.Millisecond).(time.Duration)
20-
msg := p.Get("messages", "Sleeping").(string)
21-
log.Info(c, msg)
22-
time.Sleep(dur)
23-
log.Info(c, "Woke up.")
24-
return true, nil
25-
}
26-
2712
// KillOnExit kills PIDs when the program exits.
2813
//
2914
// Otherwise, this blocks until an os.Interrupt or os.Kill is received.

pkg/commands_test.go

Lines changed: 0 additions & 26 deletions
This file was deleted.

pkg/conf/config.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
package conf
22

33
import (
4+
"fmt"
5+
"io/ioutil"
6+
47
"github.com/kelseyhightower/envconfig"
58
)
69

10+
const (
11+
builderKeyLocation = "/var/run/secrets/api/auth/builder-key"
12+
)
13+
714
func EnvConfig(appName string, conf interface{}) error {
815
if err := envconfig.Process(appName, conf); err != nil {
916
return err
1017
}
1118
return nil
1219
}
20+
21+
// GetBuilderKey returns the key to be used as token to interact with deis-workflow
22+
func GetBuilderKey() (string, error) {
23+
builderKeyBytes, err := ioutil.ReadFile(builderKeyLocation)
24+
if err != nil {
25+
return "", fmt.Errorf("couldn't get builder key from %s (%s)", builderKeyLocation, err)
26+
}
27+
builderKey := string(builderKeyBytes)
28+
return builderKey, nil
29+
}

0 commit comments

Comments
 (0)