Skip to content

Commit 86e9b5d

Browse files
committed
Use Locket presence objects
[#102329896]
1 parent 6053005 commit 86e9b5d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

cmd/bbs/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import (
2222
"github.com/cloudfoundry-incubator/cf_http"
2323
"github.com/cloudfoundry-incubator/consuladapter"
2424
"github.com/cloudfoundry-incubator/locket"
25+
"github.com/cloudfoundry-incubator/locket/presence"
2526
"github.com/cloudfoundry-incubator/rep"
26-
legacymodels "github.com/cloudfoundry-incubator/runtime-schema/models"
2727
"github.com/cloudfoundry/dropsonde"
2828
etcdclient "github.com/coreos/go-etcd/etcd"
2929
"github.com/hashicorp/consul/api"
@@ -214,7 +214,7 @@ func initializeLockMaintainer(logger lager.Logger, client *api.Client, sessionMa
214214
logger.Fatal("Advertise URL must be specified", nil)
215215
}
216216

217-
bbsPresence := legacymodels.NewBBSPresence(uuid.String(), *advertiseURL)
217+
bbsPresence := presence.NewBBSPresence(uuid.String(), *advertiseURL)
218218
lockMaintainer, err := presenceManager.NewBBSMasterLock(bbsPresence, *lockRetryInterval)
219219
if err != nil {
220220
logger.Fatal("Couldn't create lock maintainer", err)

db/consul/cells_loader_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/cloudfoundry-incubator/bbs/db"
1111
"github.com/cloudfoundry-incubator/bbs/models"
1212
"github.com/cloudfoundry-incubator/locket"
13-
oldmodels "github.com/cloudfoundry-incubator/runtime-schema/models"
13+
"github.com/cloudfoundry-incubator/locket/presence"
1414
. "github.com/onsi/ginkgo"
1515
. "github.com/onsi/gomega"
1616
"github.com/pivotal-golang/clock/fakeclock"
@@ -27,8 +27,8 @@ var _ = Describe("CellsLoader", func() {
2727
locketClient locket.Client
2828
presence1 ifrit.Process
2929
presence2 ifrit.Process
30-
firstCellPresence oldmodels.CellPresence
31-
secondCellPresence oldmodels.CellPresence
30+
firstCellPresence presence.CellPresence
31+
secondCellPresence presence.CellPresence
3232
logger *lagertest.TestLogger
3333
)
3434

@@ -37,8 +37,8 @@ var _ = Describe("CellsLoader", func() {
3737
clock = fakeclock.NewFakeClock(time.Now())
3838
locketClient = locket.NewClient(consulSession, clock, logger)
3939

40-
firstCellPresence = oldmodels.NewCellPresence("first-rep", "1.2.3.4", "the-zone", oldmodels.NewCellCapacity(128, 1024, 3), []string{}, []string{})
41-
secondCellPresence = oldmodels.NewCellPresence("second-rep", "4.5.6.7", "the-zone", oldmodels.NewCellCapacity(128, 1024, 3), []string{}, []string{})
40+
firstCellPresence = presence.NewCellPresence("first-rep", "1.2.3.4", "the-zone", presence.NewCellCapacity(128, 1024, 3), []string{}, []string{})
41+
secondCellPresence = presence.NewCellPresence("second-rep", "4.5.6.7", "the-zone", presence.NewCellCapacity(128, 1024, 3), []string{}, []string{})
4242

4343
presence1 = nil
4444
presence2 = nil
@@ -59,7 +59,7 @@ var _ = Describe("CellsLoader", func() {
5959
cellsLoader = consulDB.NewCellsLoader(logger)
6060
presence1 = ifrit.Invoke(locketClient.NewCellPresence(firstCellPresence, retryInterval))
6161

62-
Eventually(func() ([]oldmodels.CellPresence, error) {
62+
Eventually(func() ([]presence.CellPresence, error) {
6363
return locketClient.Cells()
6464
}).Should(HaveLen(1))
6565

@@ -76,7 +76,7 @@ var _ = Describe("CellsLoader", func() {
7676
BeforeEach(func() {
7777
presence2 = ifrit.Invoke(locketClient.NewCellPresence(secondCellPresence, retryInterval))
7878

79-
Eventually(func() ([]oldmodels.CellPresence, error) {
79+
Eventually(func() ([]presence.CellPresence, error) {
8080
return locketClient.Cells()
8181
}).Should(HaveLen(2))
8282
})

0 commit comments

Comments
 (0)