Skip to content

Commit 9d8f9fd

Browse files
committed
cleanup: revert unwanted changes
1 parent 2b16d2a commit 9d8f9fd

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ GEM
285285
rdoc (>= 4.0.0)
286286
reline (>= 0.4.2)
287287
jaro_winkler (1.5.6)
288-
json (2.7.5)
288+
json (2.7.4)
289289
json-diff (0.4.1)
290290
json-schema (5.0.1)
291291
addressable (~> 2.8)

app/actions/manifest_route_update.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def update(app_guid, message, user_audit_info)
5858

5959
private
6060

61-
## TODO: We also need to update when the route options differ
6261
def find_or_create_valid_route(app, manifest_route, user_audit_info)
6362
manifest_route[:candidate_host_domain_pairs].each do |candidate|
6463
potential_domain = candidate[:domain]

app/models/runtime/route.rb

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
require 'actions/services/route_binding_delete'
66

77
module VCAP::CloudController
8-
98
class Route < Sequel::Model
109
class InvalidOrganizationRelation < CloudController::Errors::InvalidRelation; end
1110

@@ -21,12 +20,12 @@ class OutOfVIPException < CloudController::Errors::InvalidRelation; end
2120

2221
# TODO: apps are actually processes
2322
many_to_many :apps, class: 'VCAP::CloudController::ProcessModel',
24-
join_table: RouteMappingModel.table_name,
25-
left_primary_key: :guid, left_key: :route_guid,
26-
right_primary_key: %i[app_guid type], right_key: %i[app_guid process_type],
27-
distinct: true,
28-
order: Sequel.asc(:id),
29-
conditions: { type: ProcessTypes::WEB }
23+
join_table: RouteMappingModel.table_name,
24+
left_primary_key: :guid, left_key: :route_guid,
25+
right_primary_key: %i[app_guid type], right_key: %i[app_guid process_type],
26+
distinct: true,
27+
order: Sequel.asc(:id),
28+
conditions: { type: ProcessTypes::WEB }
3029

3130
many_to_many :shared_spaces,
3231
left_key: :route_guid,
@@ -90,7 +89,6 @@ def options_with_serialization
9089
alias_method :options, :options_with_serialization
9190

9291
alias_method :old_path, :path
93-
9492
def path
9593
old_path.nil? ? '' : old_path
9694
end
@@ -179,8 +177,8 @@ def domains_match?
179177

180178
def validate_changed_space(new_space)
181179
raise CloudController::Errors::InvalidAppRelation.new('Route and apps not in same space') if !FeatureFlag.enabled?(:route_sharing) && apps.any? do |app|
182-
app.space.id != space.id
183-
end
180+
app.space.id != space.id
181+
end
184182
raise InvalidOrganizationRelation.new("Organization cannot use domain #{domain.name}") if domain && !domain.usable_by_organization?(new_space.organization)
185183
end
186184

@@ -238,8 +236,8 @@ def find_next_vip_offset
238236
# See SQL self-joins for the reasoning behind this
239237

240238
n = Route.exclude(vip_offset: 1).
241-
exclude { vip_offset - 1 =~ Route.select(:vip_offset) }.order(:vip_offset).get { vip_offset - 1 } ||
242-
(return (Route.max(:vip_offset) || 0) + 1)
239+
exclude { vip_offset - 1 =~ Route.select(:vip_offset) }.order(:vip_offset).get { vip_offset - 1 } ||
240+
(return (Route.max(:vip_offset) || 0) + 1)
243241
Route.where { vip_offset < n }.reverse(:vip_offset).get { vip_offset + 1 } || 1
244242
end
245243

@@ -258,9 +256,9 @@ def internal_route_vip_range_len
258256

259257
def internal_route_vip_range
260258
@internal_route_vip_range ||= begin
261-
internal_route_vip_range = Config.config.get(:internal_route_vip_range)
262-
NetAddr::IPv4Net.parse(internal_route_vip_range)
263-
end
259+
internal_route_vip_range = Config.config.get(:internal_route_vip_range)
260+
NetAddr::IPv4Net.parse(internal_route_vip_range)
261+
end
264262
end
265263

266264
def destroy_route_bindings
@@ -326,7 +324,7 @@ def validate_total_routes
326324
return unless new? && space
327325

328326
space_routes_policy = MaxRoutesPolicy.new(space.space_quota_definition, SpaceRoutes.new(space))
329-
org_routes_policy = MaxRoutesPolicy.new(space.organization.quota_definition, OrganizationRoutes.new(space.organization))
327+
org_routes_policy = MaxRoutesPolicy.new(space.organization.quota_definition, OrganizationRoutes.new(space.organization))
330328

331329
errors.add(:space, :total_routes_exceeded) if space.space_quota_definition && !space_routes_policy.allow_more_routes?(1)
332330

0 commit comments

Comments
 (0)