fix: Add policies to adapters (#4277)

The configured policy wasn't being passed in and instead the default was
being used (e.g. in the s3 file provider)

Closes: #4276

Signed-off-by: Derek Higgins <derekh@redhat.com>
(cherry picked from commit 2fce5abe34)
This commit is contained in:
Derek Higgins 2025-12-02 19:08:03 +00:00 committed by Mergify
parent 63e2e7534f
commit 6766b092bc

View file

@ -391,6 +391,9 @@ async def instantiate_provider(
method = "get_adapter_impl"
args = [config, deps]
if "policy" in inspect.signature(getattr(module, method)).parameters:
args.append(policy)
elif isinstance(provider_spec, AutoRoutedProviderSpec):
method = "get_auto_router_impl"