From 7f697ed3d9c3e81c39abf9c3b9f12c26956d9643 Mon Sep 17 00:00:00 2001 From: Ziyan Huang Date: Wed, 10 Aug 2022 19:46:40 -0700 Subject: [PATCH] Fix the bug that OneDocker unable to pass override env vars to ecs gateway Summary: TLDR OneDocker is unable to pass env vars to ecs gateway. For more context: T128688735 Differential Revision: D38607256 fbshipit-source-id: 6c652f392816e8594f67249e0457f0ea53ad8ada --- fbpcp/gateway/ecs.py | 2 +- fbpcp/service/container_aws.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fbpcp/gateway/ecs.py b/fbpcp/gateway/ecs.py index 2efed7f3..aace8124 100644 --- a/fbpcp/gateway/ecs.py +++ b/fbpcp/gateway/ecs.py @@ -73,9 +73,9 @@ def run_task( cmd: str, cluster: str, subnets: List[str], + env_vars: Optional[Dict[str, str]] = None, cpu: Optional[int] = None, memory: Optional[int] = None, - env_vars: Optional[Dict[str, str]] = None, ) -> ContainerInstance: environment = [] if env_vars: diff --git a/fbpcp/service/container_aws.py b/fbpcp/service/container_aws.py index 7b81688c..14187a8a 100644 --- a/fbpcp/service/container_aws.py +++ b/fbpcp/service/container_aws.py @@ -64,7 +64,12 @@ def create_instance( ) return self.ecs_gateway.run_task( - task_definition, container, cmd, self.cluster, self.subnets, env_vars + task_definition=task_definition, + container=container, + cmd=cmd, + cluster=self.cluster, + subnets=self.subnets, + env_vars=env_vars, ) def create_instances(