Просмотр исходного кода

feat(bootstrap): wire up the flag

This wires up `-bootstrap-url` to some code (which crashes) :)
Brandon Philips 12 лет назад
Родитель
Сommit
40a8542c22
2 измененных файлов с 13 добавлено и 0 удалено
  1. 5 0
      bootstrap/bootstrap.go
  2. 8 0
      config/config.go

+ 5 - 0
bootstrap/bootstrap.go

@@ -0,0 +1,5 @@
+package bootstrap
+
+func Do(c string) error {
+	panic(c)
+}

+ 8 - 0
config/config.go

@@ -14,6 +14,8 @@ import (
 	"strings"
 
 	"github.com/coreos/etcd/third_party/github.com/BurntSushi/toml"
+
+	"github.com/coreos/etcd/bootstrap"
 	"github.com/coreos/etcd/log"
 	"github.com/coreos/etcd/server"
 	ustrings "github.com/coreos/etcd/pkg/strings"
@@ -136,6 +138,12 @@ func (c *Config) Load(arguments []string) error {
 		return err
 	}
 
+	if c.BootstrapURL != "" {
+		if err := bootstrap.Do(c.BootstrapURL); err != nil {
+			return nil
+		}
+	}
+
 	// Sanitize all the input fields.
 	if err := c.Sanitize(); err != nil {
 		return fmt.Errorf("sanitize: %v", err)