Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
febba95
Preserve gogoproto generated files
ebroberson Apr 1, 2024
bf25c19
Protos: Remove import of gogoproto
ebroberson Mar 5, 2024
8f6e4bc
Protos: Add option go_package
ebroberson Mar 5, 2024
2ce1606
Protos: gogoproto.jsontag => json_name
ebroberson Mar 5, 2024
e5e0544
Protos: gogoproto.nullable true => optional
ebroberson Mar 5, 2024
5fd44e1
Protos: Remove gogoproto.nullable false (required fields are not vali…
ebroberson Mar 5, 2024
48cf8bc
Protos: Remove gogoproto.embed
ebroberson Mar 5, 2024
4877689
Protos: Remove gogoproto.customtype
ebroberson Mar 5, 2024
00239cc
Protos: gogoproto.enumvalue_customname => string_name
ebroberson Mar 5, 2024
9555f3c
Protos: Remove gogoproto.goproto_enum_prefix_all
ebroberson Mar 5, 2024
80c9502
Protos: Remove string_name from enums (does not work)
ebroberson Mar 5, 2024
36c0c74
Protos: Remove gogoproto.equal_all
ebroberson Mar 5, 2024
cbd3c0f
Protos:
ebroberson Mar 6, 2024
ddc9896
Protos: Change option go_package to code.cloudfoundry.org/bbs/models
ebroberson Mar 6, 2024
4ded523
Protos: omitempty no longer needed (protobuf always adds it)
ebroberson Mar 6, 2024
8c79821
Protos: Change oneof optionals to actual optionals (oneofs weren't be…
ebroberson Apr 2, 2024
dec68b3
Move gogoproto files to their own directory
ebroberson Apr 4, 2024
5754545
New protoc plugin for BBS
ebroberson Apr 26, 2024
e5d56ea
proto changes
ebroberson Apr 26, 2024
f3514cf
Add new protoc plugin for bbs code generation
ebroberson Apr 29, 2024
fb1e14d
Move bbs.proto to protoc plugin folder
ebroberson Apr 29, 2024
756bc4e
Make use of enumvalue_customvalue extension
ebroberson Apr 29, 2024
6e4f601
Support generating accessors (Get/Set)
ebroberson May 1, 2024
816650a
Import bbs.proto for enum customname extension
ebroberson May 1, 2024
89d4014
Remove duplicate methods generated by our protoc plugin
ebroberson May 1, 2024
1d8c848
Remove gogoproto proto.Message from ActionInterface
ebroberson May 1, 2024
00ef73a
Remove duplicate methods generated by our protoc plugin
ebroberson May 1, 2024
3ab24a1
Add name/value maps to enum generation
ebroberson May 1, 2024
8b8226e
Add String function to enum generation
ebroberson May 1, 2024
fe419f8
Add Equal function for struct generation
ebroberson May 1, 2024
6a0adf2
No longer ignoring ProtoRoutes
ebroberson May 1, 2024
e362317
Add getFieldName func: For adding additional logic to generated field…
ebroberson May 2, 2024
fa6d4de
CellId exists on ActualLRPInstanceKey. Golang protobuf doesn't suppor…
ebroberson May 2, 2024
50289b2
These Routables aren't messages, so don't need the 'Proto' prefix
ebroberson May 2, 2024
4213dc9
Remove duplicate methods generated by plugin
ebroberson May 2, 2024
32532d9
Add support for optional fields
ebroberson May 2, 2024
730860d
Remove support for oneof since we weren't using it (previous use of o…
ebroberson May 2, 2024
d1f7a4a
Incorrect field name used when generating ToProto function
ebroberson May 2, 2024
cb6bd3d
Remove getFieldName overrides for Actual/DesiredLRP. This wasn't cons…
ebroberson May 2, 2024
debcf87
Pointer changes due to optional field support
ebroberson May 2, 2024
e869bc7
Field name standardization on ActualLrp*
ebroberson May 2, 2024
2c6e663
Pointer changes due to optional field support
ebroberson May 2, 2024
4e0311e
Use type name instead of field name when generating an enum cast
ebroberson May 3, 2024
f9a6d84
Default value for repeated fields (arrays/slices) is nil
ebroberson May 3, 2024
4383de6
Add support for map values with a protogen'd message type
ebroberson May 3, 2024
aab5a8a
Don't need Proto prefix for string types
ebroberson May 3, 2024
45e6e42
Fix type on enumvalue_customname
ebroberson May 3, 2024
4690195
Pointer changes due to standard protobuf updates
ebroberson May 3, 2024
85f2b18
Lack of protobuf embed support requires using the structs directly
ebroberson May 3, 2024
6c176a3
Standardization of DesiredLRP=>DesiredLrp
ebroberson May 3, 2024
1b7d7bb
Remove gogoproto proto.Message
ebroberson May 3, 2024
3b3ea0d
Standardization of ActualLRP=>ActualLrp
ebroberson May 3, 2024
d725259
Pointer changes due to standard protobuf updates
ebroberson May 3, 2024
33849aa
Lack of protobuf embed support requires using the structs directly
ebroberson May 3, 2024
2c7c0af
Standardization of enum value names (include containing struct)
ebroberson May 3, 2024
afe3dbd
Weird Routes issue (assume because we aren't using the one defined in…
ebroberson May 3, 2024
b39cb66
Change package of protogen plugin to models and softlink .proto and .…
ebroberson May 3, 2024
97f8dc3
Revert package change and remove softlinks
ebroberson May 8, 2024
f4f0ebb
Handles Routes special case for Equal
ebroberson May 8, 2024
e070291
Bring back old functionality after ignoring ProtoRoutes/Routes in our…
ebroberson May 8, 2024
95e861a
Differentiate between Slices and Maps
ebroberson May 9, 2024
e201b57
Add FromProto to Routes special case
ebroberson May 9, 2024
ee2edeb
Test changes to reflect proto and model changes
ebroberson May 9, 2024
9e38bf2
Use copy instead of loop (staticcheck compliance)
ebroberson May 10, 2024
9a91be0
Remove old gogoproto generated files
ebroberson May 10, 2024
26de1ca
Add ToEventProto to Event interface and use it for Un/Marshalling
ebroberson May 10, 2024
ecfc882
Extract structs into variables and use ToProto to give back a proto.M…
ebroberson May 10, 2024
be6b673
CodeGen: add nil checks for ToProto and FromProto methods
ebroberson May 14, 2024
745a004
Update generate_protos script to handle plugin
ebroberson May 14, 2024
e7e9bf0
Use generate_protos script
ebroberson May 14, 2024
b1354ab
Codegen: Add bbs_by_value option (allows fields to be passed by value…
ebroberson May 15, 2024
d60dd78
Codegen: Add support for bbs_by_value
ebroberson May 15, 2024
ae0fcd4
Codegen: Add nil checks for ProtoSlice and ProtoMap methods
ebroberson May 15, 2024
3180189
Make custom Routes type use bbs_by_value
ebroberson May 15, 2024
39f0729
Add nil checks on ToProto/FromProto
ebroberson May 15, 2024
82737d7
Pointer changes / Proto conversion for Routes bbs_by_value
ebroberson May 15, 2024
a910918
Codegen: Don't generate a Getter for By Value types
ebroberson May 16, 2024
e228884
Add ByValue attributes to match old protobuf declarations
ebroberson May 16, 2024
b8e9612
Update pointers to reflect new ByValue types
ebroberson May 16, 2024
5e4b965
Use protojson for Marshal/Unmarshal functionality
ebroberson May 16, 2024
5882354
Add json_name tags to prevent camelCase from happening
ebroberson May 16, 2024
103b384
Add GetProto for Actions so we can marshal/unmarshal correctly
ebroberson May 16, 2024
a4e7210
Update tests to account for protojson and protobuf changes
ebroberson May 16, 2024
be14418
Codegen: Add support for ExcludeFromEqual feature and regenerate code…
ebroberson May 17, 2024
28b4747
Add ExcludeFromEqual to Error.Message; regenerate error.proto
ebroberson May 17, 2024
505dcb5
Add special case for Action types (they need GetValue and SetValue)
ebroberson May 17, 2024
34bccf0
Update SecurityGroups test for protobuf and protojson changes
ebroberson May 17, 2024
5d3cfde
Add json_names for fields with underscores
ebroberson May 17, 2024
cd445bf
Update Task test for protobuf and protojson changes
ebroberson May 17, 2024
66e0094
Codegen: Remove extra log messages, use Desc.Name() for ignoredMessages
ebroberson May 23, 2024
59ae0ec
Add explicit json_name for static and dynamic
ebroberson May 23, 2024
684c21c
WIP: What if Routes wasn't a special case?
ebroberson May 23, 2024
6e31fc1
Redirect output from pushd/popd to /dev/null
ebroberson May 29, 2024
bcaf619
Add JsonAlwaysEmit and CustomType features; Regenerate protos for cod…
ebroberson May 29, 2024
887f23f
Codegen: alwaysEmit->jsonEmit
ebroberson May 30, 2024
b069c7c
Codegen: Action no longer needs special Get/SetValue in accessors
ebroberson May 30, 2024
db69970
Codegen: Handle optional fields better:
ebroberson May 30, 2024
f938a62
Protos: Add AlwaysEmit options to Messages to match old protobuf results
ebroberson May 30, 2024
fe81ce2
copy() is destination first
ebroberson May 30, 2024
996a74c
Remove usage of protojson, encoding/json package is enough for our us…
ebroberson May 30, 2024
544e998
Naming convention changes due to protobuf updates
ebroberson May 31, 2024
20d5acb
Have to pass a Proto struct in order to populate correctly, then use …
ebroberson May 31, 2024
f2159b9
Naming convention changes due to protobuf updates
ebroberson May 31, 2024
8266589
Have to use Proto structs (.ToProto()) in proto.Marshal
ebroberson May 31, 2024
2886e08
Add Validate functions for Proto structs
ebroberson May 31, 2024
6f3d82f
Structure and naming changes due to Protobuf upgrades
ebroberson May 31, 2024
07ffcca
Use google.golang protobuf instead of gogo protobuf
ebroberson May 31, 2024
e7618d8
Add ToEventProto for models.Event interface
ebroberson Jun 3, 2024
2f46136
Add conversions for protobuf messages
ebroberson Jun 3, 2024
eb4cb98
expectedEvent doesn't need to be converted to a Proto here
ebroberson Jun 3, 2024
12204c6
Updated loggregator to v9
ebroberson Jun 3, 2024
12fe191
Naming convention changes due to new protobuf
ebroberson Jun 3, 2024
0aadbbb
Added support for deprecated things to be marked as such in the outpu…
ebroberson Jun 5, 2024
a4a0f77
Struct and naming convention changes; Trueing up lint deprecation
ebroberson Jun 5, 2024
cd35f55
Make integration tests use new protobuf
ebroberson Jun 14, 2024
434b8d4
Ginkgo unfocus + lint ignore for deprecated method testing
ebroberson Jul 10, 2024
e9e1604
Lint ignore for unnecessary nil check
ebroberson Jul 10, 2024
47c81fc
Change responses to use pointers so we can use them after the method …
ebroberson Jul 10, 2024
e3d9faa
Need to store the deserializeModel result in a variable to use later
ebroberson Jul 15, 2024
cfa15d3
Routable is a pointer and needs to be dereferenced
ebroberson Jul 15, 2024
8b4cf1e
Make FakeEvent a proper proto object
ebroberson Jul 16, 2024
35019df
Replace eventfakes with new FakeEvent object
ebroberson Jul 16, 2024
85ca46b
We can use d.Routes directly here since it's a pointer
ebroberson Jul 16, 2024
8372c58
Change interface{} to explicit type so we can use ToProto() and send …
ebroberson Jul 16, 2024
6664b33
Remove debug log statements
ebroberson Jul 16, 2024
075ee2e
Change to match new protobufs
ebroberson Sep 3, 2024
cc0e5c8
Need to send a proto.Message to newTestRequest
ebroberson Oct 16, 2024
8429185
Remove extra JustBeforeEach
ebroberson Oct 16, 2024
d68708b
InternalRoutesFromRoutingInfo now takes a pointer
ebroberson Jan 23, 2025
92a449b
Add new custom proto field bbs_default_value
ebroberson Feb 6, 2025
4046871
Fix typo from rebase
ebroberson Feb 7, 2025
055e495
Fix merge issues
ebroberson Feb 10, 2025
22f6036
Final removal of old protobuf models
ebroberson Feb 10, 2025
7d2d632
Merge branch 'main' into protobuf-with-plugin
ebroberson Feb 12, 2025
a4bd5b6
VolumeMountedFiles needs to be always_emit
ebroberson Feb 12, 2025
0118bf6
Update docs for new protobufs
ebroberson Feb 14, 2025
e561432
Add GetProto() to ActionInterface
ebroberson Feb 19, 2025
f7314a9
Cleanup commented code that's not longer needed
ebroberson Feb 19, 2025
400d5a0
go.mod and go.sum not needed: use the ones from diego-release
ebroberson Feb 19, 2025
c92f8b1
Add performance tests and results for new (google) protobufs
ebroberson Feb 21, 2025
fb9d58e
Use results from new script
ebroberson Feb 24, 2025
4ba4c9a
WIP
ebroberson Feb 26, 2025
5d7065d
Copy-paste error for ignoredEnums
ebroberson Mar 12, 2025
7c3a58d
Change to use new backwards-compatible locket protobufs
ebroberson Mar 12, 2025
c60c742
Base grpc generation
ebroberson Mar 14, 2025
ab3dffc
Remove TypeCode_ prefix
ebroberson Mar 24, 2025
56fdbc8
Regen protos with protoc v6.30.2
ebroberson Mar 31, 2025
8bdabc9
Update grpc templates to convert to/from Proto structs
ebroberson Apr 1, 2025
95029bf
Merge branch 'main' into protobuf-with-plugin
ebroberson Apr 8, 2025
3a39082
Refactor emit* functions to conform to metrics documentation linter
ebroberson Apr 10, 2025
ef556e3
Merge branch 'metrics-linter' into protobuf-with-plugin
ebroberson Apr 10, 2025
66bcdfe
Update grpc templates to use Proto clients
ebroberson Apr 14, 2025
277a182
Merge branch 'main' into protobuf-with-plugin
ebroberson Apr 17, 2025
184cae3
Resolve staticcheck ST1023 (omit gmeasure.PrecisionBundle from declar…
ebroberson May 6, 2025
af32436
Remove ProtoLocketClient
ebroberson May 9, 2025
4060736
Have to initialize in after dec(protoIn) has run
ebroberson May 9, 2025
c85c0fb
Allow performance tests to be skipped easily
ebroberson May 12, 2025
95eb400
Fix scoping problem with reuse of task variable
ebroberson May 12, 2025
5e5e882
Merge branch 'main' into protobuf-with-plugin
ebroberson Jun 30, 2025
af26f07
Regen protos
ebroberson Jun 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 129 additions & 85 deletions client.go

Large diffs are not rendered by default.

116 changes: 64 additions & 52 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,33 +61,36 @@ var _ = Describe("Client", func() {
It("populates the request", func() {
actualLRP := model_helpers.NewValidActualLRP("some-guid", 0)
request := models.StartActualLRPRequest{
ActualLrpKey: &actualLRP.ActualLRPKey,
ActualLrpInstanceKey: &actualLRP.ActualLRPInstanceKey,
ActualLrpNetInfo: &actualLRP.ActualLRPNetInfo,
ActualLrpKey: &actualLRP.ActualLrpKey,
ActualLrpInstanceKey: &actualLRP.ActualLrpInstanceKey,
ActualLrpNetInfo: &actualLRP.ActualLrpNetInfo,
ActualLrpInternalRoutes: actualLRP.ActualLrpInternalRoutes,
MetricTags: actualLRP.MetricTags,
AvailabilityZone: actualLRP.AvailabilityZone,
}
request.SetRoutable(false)
routable := false
request.SetRoutable(&routable)
response := &models.ActualLRPLifecycleResponse{Error: nil}
bbsServer.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/v1/actual_lrps/start.r1"),
ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}),
ghttp.VerifyProtoRepresenting(&request),
ghttp.RespondWithProto(200, &models.ActualLRPLifecycleResponse{Error: nil}),
ghttp.VerifyProtoRepresenting(request.ToProto()),
ghttp.RespondWithProto(200, response.ToProto()),
),
)

err := internalClient.StartActualLRP(logger, "some-trace-id", &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, false, actualLRP.AvailabilityZone)
err := internalClient.StartActualLRP(logger, "some-trace-id", &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, false, actualLRP.AvailabilityZone)
Expect(err).NotTo(HaveOccurred())
})

It("Calls the current endpoint", func() {
response := &models.ActualLRPLifecycleResponse{Error: nil}
bbsServer.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/v1/actual_lrps/start.r1"),
ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}),
ghttp.RespondWithProto(200, &models.ActualLRPLifecycleResponse{Error: nil}),
ghttp.RespondWithProto(200, response.ToProto()),
),
)

Expand All @@ -97,6 +100,15 @@ var _ = Describe("Client", func() {

It("Falls back to the deprecated endpoint if the current endpoint returns a 404", func() {
actualLRP := model_helpers.NewValidActualLRP("some-guid", 0)
request := &models.StartActualLRPRequest{
ActualLrpKey: &actualLRP.ActualLrpKey,
ActualLrpInstanceKey: &actualLRP.ActualLrpInstanceKey,
ActualLrpNetInfo: &actualLRP.ActualLrpNetInfo,
ActualLrpInternalRoutes: nil,
MetricTags: nil,
AvailabilityZone: "",
}
response := &models.ActualLRPLifecycleResponse{Error: nil}
bbsServer.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/v1/actual_lrps/start.r1"),
Expand All @@ -106,19 +118,12 @@ var _ = Describe("Client", func() {
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/v1/actual_lrps/start"),
ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}),
ghttp.VerifyProtoRepresenting(&models.StartActualLRPRequest{
ActualLrpKey: &actualLRP.ActualLRPKey,
ActualLrpInstanceKey: &actualLRP.ActualLRPInstanceKey,
ActualLrpNetInfo: &actualLRP.ActualLRPNetInfo,
ActualLrpInternalRoutes: nil,
MetricTags: nil,
AvailabilityZone: "",
}),
ghttp.RespondWithProto(200, &models.ActualLRPLifecycleResponse{Error: nil}),
ghttp.VerifyProtoRepresenting(request.ToProto()),
ghttp.RespondWithProto(200, response.ToProto()),
),
)

err := internalClient.StartActualLRP(logger, "some-trace-id", &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, actualLRP.GetRoutable(), actualLRP.AvailabilityZone)
err := internalClient.StartActualLRP(logger, "some-trace-id", &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, *actualLRP.GetRoutable(), actualLRP.AvailabilityZone)
Expect(err).NotTo(HaveOccurred())
})

Expand Down Expand Up @@ -157,32 +162,35 @@ var _ = Describe("Client", func() {
Context("evacuateRunningActualLrp", func() {
It("populates the request", func() {
actualLRP := model_helpers.NewValidActualLRP("some-guid", 0)
request := &models.EvacuateRunningActualLRPRequest{
ActualLrpKey: &actualLRP.ActualLrpKey,
ActualLrpInstanceKey: &actualLRP.ActualLrpInstanceKey,
ActualLrpNetInfo: &actualLRP.ActualLrpNetInfo,
ActualLrpInternalRoutes: actualLRP.ActualLrpInternalRoutes,
MetricTags: actualLRP.MetricTags,
AvailabilityZone: actualLRP.AvailabilityZone,
Routable: actualLRP.GetRoutable(),
}
response := &models.EvacuationResponse{KeepContainer: true, Error: nil}
bbsServer.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/v1/actual_lrps/evacuate_running.r1"),
ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}),
ghttp.VerifyProtoRepresenting(&models.EvacuateRunningActualLRPRequest{
ActualLrpKey: &actualLRP.ActualLRPKey,
ActualLrpInstanceKey: &actualLRP.ActualLRPInstanceKey,
ActualLrpNetInfo: &actualLRP.ActualLRPNetInfo,
ActualLrpInternalRoutes: actualLRP.ActualLrpInternalRoutes,
MetricTags: actualLRP.MetricTags,
AvailabilityZone: actualLRP.AvailabilityZone,
OptionalRoutable: &models.EvacuateRunningActualLRPRequest_Routable{Routable: actualLRP.GetRoutable()},
}),
ghttp.RespondWithProto(200, &models.EvacuationResponse{KeepContainer: true, Error: nil}),
ghttp.VerifyProtoRepresenting(request.ToProto()),
ghttp.RespondWithProto(200, response.ToProto()),
),
)

_, err := internalClient.EvacuateRunningActualLRP(logger, "some-trace-id", &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, actualLRP.GetRoutable(), actualLRP.AvailabilityZone)
_, err := internalClient.EvacuateRunningActualLRP(logger, "some-trace-id", &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, *actualLRP.GetRoutable(), actualLRP.AvailabilityZone)
Expect(err).NotTo(HaveOccurred())
})
It("Calls the current endpoint", func() {
response := &models.EvacuationResponse{KeepContainer: true, Error: nil}
bbsServer.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/v1/actual_lrps/evacuate_running.r1"),
ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}),
ghttp.RespondWithProto(200, &models.EvacuationResponse{KeepContainer: true, Error: nil}),
ghttp.RespondWithProto(200, response.ToProto()),
),
)

Expand All @@ -192,6 +200,16 @@ var _ = Describe("Client", func() {

It("Falls back to the deprecated endpoint if the current endpoint returns a 404", func() {
actualLRP := model_helpers.NewValidActualLRP("some-guid", 0)
request := &models.EvacuateRunningActualLRPRequest{
ActualLrpKey: &actualLRP.ActualLrpKey,
ActualLrpInstanceKey: &actualLRP.ActualLrpInstanceKey,
ActualLrpNetInfo: &actualLRP.ActualLrpNetInfo,
ActualLrpInternalRoutes: nil,
MetricTags: nil,
Routable: nil,
AvailabilityZone: "",
}
response := &models.EvacuationResponse{KeepContainer: true, Error: nil}
bbsServer.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/v1/actual_lrps/evacuate_running.r1"),
Expand All @@ -201,20 +219,12 @@ var _ = Describe("Client", func() {
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/v1/actual_lrps/evacuate_running"),
ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}),
ghttp.VerifyProtoRepresenting(&models.EvacuateRunningActualLRPRequest{
ActualLrpKey: &actualLRP.ActualLRPKey,
ActualLrpInstanceKey: &actualLRP.ActualLRPInstanceKey,
ActualLrpNetInfo: &actualLRP.ActualLRPNetInfo,
ActualLrpInternalRoutes: nil,
MetricTags: nil,
OptionalRoutable: nil,
AvailabilityZone: "",
}),
ghttp.RespondWithProto(200, &models.EvacuationResponse{KeepContainer: true, Error: nil}),
ghttp.VerifyProtoRepresenting(request.ToProto()),
ghttp.RespondWithProto(200, response.ToProto()),
),
)

_, err := internalClient.EvacuateRunningActualLRP(logger, "some-trace-id", &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey, &actualLRP.ActualLRPNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, false, actualLRP.AvailabilityZone)
_, err := internalClient.EvacuateRunningActualLRP(logger, "some-trace-id", &actualLRP.ActualLrpKey, &actualLRP.ActualLrpInstanceKey, &actualLRP.ActualLrpNetInfo, actualLRP.ActualLrpInternalRoutes, actualLRP.MetricTags, false, actualLRP.AvailabilityZone)
Expect(err).NotTo(HaveOccurred())
})

Expand Down Expand Up @@ -342,24 +352,26 @@ var _ = Describe("Client", func() {
})

JustBeforeEach(func() {
//lint:ignore SA1019 - testing of deprecated code
response := &models.ActualLRPGroupsResponse{
//lint:ignore SA1019 - testing of deprecated code
ActualLrpGroups: []*models.ActualLRPGroup{
{
Instance: &models.ActualLRP{
State: "running",
},
},
},
}
bbsServer.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/v1/actual_lrp_groups/list"),
ghttp.VerifyHeader(http.Header{"X-Vcap-Request-Id": []string{"some-trace-id"}}),
func(w http.ResponseWriter, req *http.Request) {
<-blockCh
},
//lint:ignore SA1019 - testing of deprecated code
ghttp.RespondWithProto(200, &models.ActualLRPGroupsResponse{
//lint:ignore SA1019 - testing of deprecated code
ActualLrpGroups: []*models.ActualLRPGroup{
{
Instance: &models.ActualLRP{
State: "running",
},
},
},
}),
// lint:ignore SA1019 - testing of deprecated code
ghttp.RespondWithProto(200, response.ToProto()),
),
)
})
Expand Down
Loading