diff --git a/flytekit/clis/sdk_in_container/run.py b/flytekit/clis/sdk_in_container/run.py index bd87f7b64b..e2887ce51a 100644 --- a/flytekit/clis/sdk_in_container/run.py +++ b/flytekit/clis/sdk_in_container/run.py @@ -595,7 +595,7 @@ def _get_params( defaults: typing.Optional[typing.Dict[str, Parameter]] = None, ) -> typing.List["click.Parameter"]: params = [] - flyte_ctx = context_manager.FlyteContextManager.current_context() + flyte_ctx = ctx.obj.remote_instance().context for name, var in inputs.items(): if fixed and name in fixed: continue @@ -609,6 +609,7 @@ def _get_params( return params def get_params(self, ctx: click.Context) -> typing.List["click.Parameter"]: + ctx.obj.remote = True if not self.params: self.params = [] entity = self._fetch_entity(ctx)