Skip to content

Commit

Permalink
Correctly reference used ports key when validating app ports
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicaj committed Jul 23, 2024
1 parent bbfdd38 commit 99cb855
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ def validate_acl_entries(self, verrors, value, question, schema_name, app_data):
verrors.add(schema_name, f'{value["path"]}: path does not exist')

async def validate_port_available_on_node(self, verrors, value, question, schema_name, app_data):
if app_data and value in [p['port'] for p in app_data['used_ports']]:
if app_data and value in [
host_port['host_port']
for port_entry in app_data['active_workloads']['used_ports']
for host_port in port_entry['host_ports']
]:
# TODO: This still leaves a case where user has multiple ports in a single app and mixes
# them to the same value however in this case we will still get an error raised by docker.
return
Expand Down

0 comments on commit 99cb855

Please sign in to comment.