diff --git a/etcd/etcd.go b/etcd/etcd.go index 3b14800a6..6cd2b7c9b 100644 --- a/etcd/etcd.go +++ b/etcd/etcd.go @@ -160,16 +160,6 @@ func (s *Server) RaftHandler() http.Handler { return s.rh } -func (s *Server) ClusterConfig() *config.ClusterConfig { - c := config.NewClusterConfig() - // This is used for backward compatibility because it doesn't - // set cluster config in older version. - if e, err := s.Get(v2configKVPrefix, false, false); err == nil { - json.Unmarshal([]byte(*e.Node.Value), c) - } - return c -} - func (s *Server) Run() { if len(s.config.Peers) == 0 { s.Bootstrap() diff --git a/etcd/v2_admin.go b/etcd/v2_admin.go index 7be3c08f9..2544c278c 100644 --- a/etcd/v2_admin.go +++ b/etcd/v2_admin.go @@ -9,6 +9,7 @@ import ( "strconv" "strings" + "github.com/coreos/etcd/config" "github.com/coreos/etcd/store" ) @@ -101,6 +102,16 @@ func (s *Server) serveAdminMachines(w http.ResponseWriter, r *http.Request) erro return nil } +func (s *Server) ClusterConfig() *config.ClusterConfig { + c := config.NewClusterConfig() + // This is used for backward compatibility because it doesn't + // set cluster config in older version. + if e, err := s.Get(v2configKVPrefix, false, false); err == nil { + json.Unmarshal([]byte(*e.Node.Value), c) + } + return c +} + // someMachineMessage return machine message of specified name. func (s *Server) someMachineMessage(name string) (*machineMessage, error) { p := filepath.Join(v2machineKVPrefix, name)