Skip to content

Commit

Permalink
fix: Added missing add_host parameter to start-api entry methods (#6551)
Browse files Browse the repository at this point in the history
* Fixed merge issue where --add-host was not merged correctly

* Add host to test class base
  • Loading branch information
lucashuy authored Jan 15, 2024
1 parent 8cb45e3 commit 8dfccdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions samcli/commands/local/start_api/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def do_cli( # pylint: disable=R0914
debug_function,
container_host,
container_host_interface,
add_host,
invoke_image,
hook_name,
ssl_cert_file,
Expand Down Expand Up @@ -251,6 +252,7 @@ def do_cli( # pylint: disable=R0914
container_host=container_host,
container_host_interface=container_host_interface,
invoke_images=processed_invoke_images,
add_host=add_host,
) as invoke_context:
ssl_context = (ssl_cert_file, ssl_key_file) if ssl_cert_file else None
service = LocalApiService(
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/commands/local/start_api/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def setUp(self):
self.ssl_cert_file = None
self.ssl_key_file = None
self.static_dir = "staticdir"
self.add_host = []

self.container_host = "localhost"
self.container_host_interface = "127.0.0.1"
Expand Down Expand Up @@ -94,6 +95,7 @@ def test_cli_must_setup_context_and_start_service(self, local_api_service_mock,
shutdown=self.shutdown,
container_host=self.container_host,
container_host_interface=self.container_host_interface,
add_host=self.add_host,
invoke_images={},
)

Expand Down Expand Up @@ -225,4 +227,5 @@ def call_cli(self):
ssl_cert_file=self.ssl_cert_file,
ssl_key_file=self.ssl_key_file,
disable_authorizer=self.disable_authorizer,
add_host=self.add_host,
)

0 comments on commit 8dfccdc

Please sign in to comment.