Skip to content

Commit

Permalink
Pass routable to EvacuateRunningActualLRP call
Browse files Browse the repository at this point in the history
  • Loading branch information
mariash committed Jul 14, 2023
1 parent e3c0958 commit 2b4b5a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generator/internal/evacuation_lrp_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (p *evacuationLRPProcessor) processRunningContainer(logger lager.Logger, tr
for _, internalRoute := range lrpContainer.InternalRoutes {
internalRoutes = append(internalRoutes, &models.ActualLRPInternalRoute{Hostname: internalRoute.Hostname})
}
keepContainer, err := p.bbsClient.EvacuateRunningActualLRP(logger, traceID, lrpContainer.ActualLRPKey, lrpContainer.ActualLRPInstanceKey, netInfo, internalRoutes, lrpContainer.MetricsConfig.Tags)
keepContainer, err := p.bbsClient.EvacuateRunningActualLRP(logger, traceID, lrpContainer.ActualLRPKey, lrpContainer.ActualLRPInstanceKey, netInfo, internalRoutes, lrpContainer.MetricsConfig.Tags, lrpContainer.Routable)
if keepContainer == false {
p.containerDelegate.DeleteContainer(logger, traceID, lrpContainer.Container.Guid)
} else if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion generator/internal/evacuation_lrp_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,19 @@ var _ = Describe("EvacuationLrpProcessor", func() {
container.InternalRoutes = internalroutes.InternalRoutes{{Hostname: "some-internal-route.apps.internal"}, {Hostname: "some-other-internal-route"}}
lrpNetInfo = models.NewActualLRPNetInfo(externalIP, internalIP, models.ActualLRPNetInfo_PreferredAddressHost, models.NewPortMapping(8642, 1357))
container.MetricsConfig.Tags = map[string]string{"app_name": "some-application"}
container.Routable = true
})

It("evacuates the lrp", func() {
Expect(fakeBBS.EvacuateRunningActualLRPCallCount()).To(Equal(1))
_, traceID, actualLRPKey, actualLRPContainerKey, actualLRPNetInfo, internalRoutes, metricTags := fakeBBS.EvacuateRunningActualLRPArgsForCall(0)
_, traceID, actualLRPKey, actualLRPContainerKey, actualLRPNetInfo, internalRoutes, metricTags, routable := fakeBBS.EvacuateRunningActualLRPArgsForCall(0)
Expect(traceID).To(Equal("some-trace-id"))
Expect(*actualLRPKey).To(Equal(lrpKey))
Expect(*actualLRPContainerKey).To(Equal(lrpInstanceKey))
Expect(*actualLRPNetInfo).To(Equal(lrpNetInfo))
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 2b4b5a2

Please sign in to comment.