Skip to content

Commit

Permalink
Pass Routable to BBS in StartActualLRP
Browse files Browse the repository at this point in the history
Signed-off-by: Maria Shaldybin <[email protected]>
  • Loading branch information
reneighbor authored and mariash committed Jun 23, 2023
1 parent 8550a63 commit 957a0e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions generator/internal/ordinary_lrp_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ func (p *ordinaryLRPProcessor) processRunningContainer(logger lager.Logger, trac
}
logger.Debug("succeeded-extracting-net-info-from-container")

logger.Info("bbs-start-actual-lrp", lager.Data{"net_info": netInfo})
logger.Info("bbs-start-actual-lrp", lager.Data{"net_info": netInfo, "routable": lrpContainer.Routable})
internalRoutes := []*models.ActualLRPInternalRoute{}
for _, internalRoute := range lrpContainer.InternalRoutes {
internalRoutes = append(internalRoutes, &models.ActualLRPInternalRoute{Hostname: internalRoute.Hostname})
}
err = p.bbsClient.StartActualLRP(logger, traceID, lrpContainer.ActualLRPKey, lrpContainer.ActualLRPInstanceKey, netInfo, internalRoutes, lrpContainer.MetricsConfig.Tags)
err = p.bbsClient.StartActualLRP(logger, traceID, lrpContainer.ActualLRPKey, lrpContainer.ActualLRPInstanceKey, netInfo, internalRoutes, lrpContainer.MetricsConfig.Tags, lrpContainer.Routable)
bbsErr := models.ConvertError(err)
if bbsErr != nil && bbsErr.Type == models.Error_ActualLRPCannotBeStarted {
p.containerDelegate.StopContainer(logger, traceID, lrpContainer.Guid)
Expand Down
4 changes: 3 additions & 1 deletion generator/internal/ordinary_lrp_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,19 @@ var _ = Describe("OrdinaryLRPProcessor", func() {
container.Ports = []executor.PortMapping{{ContainerPort: 8080, HostPort: 61999}}
container.InternalRoutes = internalroutes.InternalRoutes{{Hostname: "some-internal-route.apps.internal"}, {Hostname: "some-other-internal-route"}}
container.MetricsConfig.Tags = map[string]string{"app_name": "some-application"}
container.Routable = true
})

It("starts the lrp", func() {
Expect(bbsClient.StartActualLRPCallCount()).To(Equal(1))
_, traceID, lrpKey, instanceKey, netInfo, internalRoutes, metricTags := bbsClient.StartActualLRPArgsForCall(0)
_, traceID, lrpKey, instanceKey, netInfo, internalRoutes, metricTags, routable := bbsClient.StartActualLRPArgsForCall(0)
Expect(traceID).To(Equal("some-trace-id"))
Expect(*lrpKey).To(Equal(expectedLrpKey))
Expect(*instanceKey).To(Equal(expectedInstanceKey))
Expect(*netInfo).To(Equal(expectedNetInfo))
Expect(internalRoutes).To(Equal([]*models.ActualLRPInternalRoute{{Hostname: "some-internal-route.apps.internal"}, {Hostname: "some-other-internal-route"}}))
Expect(metricTags).To(Equal(map[string]string{"app_name": "some-application"}))
Expect(routable).To(Equal(true))

Eventually(logger).Should(Say(
fmt.Sprintf(
Expand Down

0 comments on commit 957a0e5

Please sign in to comment.