Skip to content

Commit d5c5fe1

Browse files
committed
wip: fix route update via manifest
1 parent 54d6bb5 commit d5c5fe1

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app/actions/manifest_route_update.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require 'cloud_controller/app_manifest/manifest_route'
22
require 'actions/route_create'
3+
require 'actions/route_update'
34

45
module VCAP::CloudController
56
class ManifestRouteUpdate
@@ -94,12 +95,10 @@ def find_or_create_valid_route(app, manifest_route, user_audit_info)
9495
)
9596
elsif route[:options] != manifest_route[:options]
9697
message = RouteUpdateMessage.new({
97-
'host' => host,
98-
'path' => manifest_route[:path],
99-
'port' => manifest_route[:port],
10098
'options' => manifest_route[:options]
10199
})
102-
route = RouteUpdate.update(route, message)
100+
route = RouteUpdate.new.update(route:, message:)
101+
103102
elsif route.space.guid != app.space_guid
104103
raise InvalidRoute.new('Routes cannot be mapped to destinations in different spaces')
105104
end

app/presenters/v3/app_manifest_presenters/route_properties_presenter.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ def to_hash(route_mappings:, app:, **_)
1010
protocol: route_mapping.protocol
1111
}
1212

13-
route_hash[:options]['loadbalancing-algorithm'] = route_mapping.route.options['lb_algo'] if route_mapping.route.options && route_mapping.route.options['lb_algo']
13+
if route_mapping.route.options
14+
route_hash[:options] = {}
15+
route_hash[:options]['loadbalancing-algorithm'] = route_mapping.route.options['lb_algo'] if route_mapping.route.options['lb_algo']
16+
end
1417

1518
route_hash
1619
end

0 commit comments

Comments
 (0)