Skip to content

Commit 429e90b

Browse files
committed
POST and GET routes use route options
1 parent c3fe3a8 commit 429e90b

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

app/actions/route_create.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def create(message:, space:, domain:, manifest_triggered: false)
1515
path: message.path || '',
1616
port: port(message, domain),
1717
space: space,
18-
domain: domain
18+
domain: domain,
19+
options: message.options
1920
)
2021

2122
Route.db.transaction do

app/controllers/v3/routes_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def create
7878

7979
space = Space.find(guid: message.space_guid)
8080
domain = Domain.find(guid: message.domain_guid)
81+
options = message.
8182

8283
unprocessable_space! unless space
8384
unprocessable_domain! unless domain

app/messages/route_create_message.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,12 @@ def domain_guid
8585
HashUtils.dig(domain, :data, :guid)
8686
end
8787
end
88+
89+
# class RouteOptions < BaseMessage
90+
# register_allowed_keys %i[loadbalancing-algorithm]
91+
# validates_with NoAdditionalKeysValidator
92+
# validates :loadbalancing-algorithm, to_one_relationship: true
93+
# end
94+
8895
end
8996
end

app/presenters/v3/route_presenter.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def to_hash
3434
port: route.port,
3535
url: build_url,
3636
destinations: RouteDestinationsPresenter.new(route.route_mappings, route:).presented_destinations,
37+
options: route.options,
3738
metadata: {
3839
labels: hashified_labels(route.labels),
3940
annotations: hashified_annotations(route.annotations)

lib/cloud_controller/diego/app_recipe_builder.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ def generate_routes(info)
156156
port: i['port'],
157157
route_service_url: i['route_service_url'],
158158
isolation_segment: IsolationSegmentSelector.for_space(process.space),
159-
protocol: i['protocol']
159+
protocol: i['protocol'],
160+
options: i['options']
160161
}
161162
end
162163

0 commit comments

Comments
 (0)