Skip to content

Commit 49e012f

Browse files
author
James DeFelice
committed
migrate from /state.json to /state
1 parent 0d5b1f4 commit 49e012f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

detector/standalone.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ func (s *Standalone) Cancel() {
107107
s.cancelOnce.Do(func() { close(s.done) })
108108
}
109109

110-
// poll for changes to master leadership via current leader's /state.json endpoint.
110+
// poll for changes to master leadership via current leader's /state endpoint.
111111
// we poll the `initial` leader, aborting if none was specified.
112112
//
113113
// TODO(jdef) follow the leader: change who we poll based on the prior leader
114-
// TODO(jdef) somehow determine all masters in cluster from the state.json?
114+
// TODO(jdef) somehow determine all masters in cluster from the /state?
115115
//
116116
func (s *Standalone) _poller(pf fetcherFunc) {
117117
defer func() {
@@ -193,7 +193,7 @@ func (s *Standalone) _poller(pf fetcherFunc) {
193193
// assumes that address is in host:port format
194194
func (s *Standalone) _fetchPid(ctx context.Context, address string) (*upid.UPID, error) {
195195
//TODO(jdef) need SSL support
196-
uri := fmt.Sprintf("http://%s/state.json", address)
196+
uri := fmt.Sprintf("http://%s/state", address)
197197
req, err := http.NewRequest("GET", uri, nil)
198198
if err != nil {
199199
return nil, err

testutil/testingutil.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func NewMockMasterHttpServer(t *testing.T, handler func(rsp http.ResponseWriter,
6868
var server *httptest.Server
6969
when := make(map[string]http.HandlerFunc)
7070
stateHandler := func(rsp http.ResponseWriter, req *http.Request) {
71-
if "/state.json" == req.RequestURI {
71+
if "/state" == req.RequestURI {
7272
state := fmt.Sprintf(`{ "leader": "master@%v" }`, server.Listener.Addr())
7373
log.V(1).Infof("returning JSON %v", state)
7474
io.WriteString(rsp, state)

0 commit comments

Comments
 (0)