Use http:// as etcd URL scheme

Using tcp:// does not work.
This commit is contained in:
Hannes Hörl 2017-11-23 15:18:54 +00:00 committed by Gareth Smith
parent 4e870ff442
commit 0dfe20ef49
2 changed files with 4 additions and 4 deletions

View File

@ -72,10 +72,10 @@ func (t *tempDirManager) Destroy() error {
// Start will start all your fixtures. To stop them, call Stop(). // Start will start all your fixtures. To stop them, call Stop().
func (f *Fixtures) Start() error { func (f *Fixtures) Start() error {
tmpDir := f.TempDirManager.Create() tmpDir := f.TempDirManager.Create()
if err := f.Etcd.Start("tcp://127.0.0.1:2379", tmpDir); err != nil { if err := f.Etcd.Start("http://127.0.0.1:2379", tmpDir); err != nil {
return fmt.Errorf("Error starting etcd: %s", err) return fmt.Errorf("Error starting etcd: %s", err)
} }
if err := f.APIServer.Start("tcp://127.0.0.1:2379"); err != nil { if err := f.APIServer.Start("http://127.0.0.1:2379"); err != nil {
return fmt.Errorf("Error starting apiserver: %s", err) return fmt.Errorf("Error starting apiserver: %s", err)
} }
return nil return nil

View File

@ -49,14 +49,14 @@ var _ = Describe("Fixtures", func() {
Expect(fakeEtcdStartStopper.StartCallCount()).To(Equal(1), Expect(fakeEtcdStartStopper.StartCallCount()).To(Equal(1),
"the EtcdStartStopper should be called exactly once") "the EtcdStartStopper should be called exactly once")
url, datadir := fakeEtcdStartStopper.StartArgsForCall(0) url, datadir := fakeEtcdStartStopper.StartArgsForCall(0)
Expect(url).To(Equal("tcp://127.0.0.1:2379")) Expect(url).To(Equal("http://127.0.0.1:2379"))
Expect(datadir).To(Equal("some temp dir")) Expect(datadir).To(Equal("some temp dir"))
By("starting APIServer") By("starting APIServer")
Expect(fakeAPIServerStartStopper.StartCallCount()).To(Equal(1), Expect(fakeAPIServerStartStopper.StartCallCount()).To(Equal(1),
"the APIServerStartStopper should be called exactly once") "the APIServerStartStopper should be called exactly once")
url = fakeAPIServerStartStopper.StartArgsForCall(0) url = fakeAPIServerStartStopper.StartArgsForCall(0)
Expect(url).To(Equal("tcp://127.0.0.1:2379")) Expect(url).To(Equal("http://127.0.0.1:2379"))
}) })
Context("when starting etcd fails", func() { Context("when starting etcd fails", func() {