refactor: Align build and run provider datatypes

introduce the concept of a `module` for users to specify for a provider upon build time.
In order to facilitate this, align the build and run spec to use `Provider` class rather than the stringified provider_type that build currently uses.

Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
Charlie Doern 2025-07-06 19:56:18 -04:00
parent 21bae296f2
commit 233f8c81bf
6 changed files with 48 additions and 38 deletions

View file

@ -345,7 +345,7 @@ async def instantiate_provider(
policy: list[AccessRule],
):
provider_spec = provider.spec
if not hasattr(provider_spec, "module"):
if not hasattr(provider_spec, "module") or provider_spec.module is None:
raise AttributeError(f"ProviderSpec of type {type(provider_spec)} does not have a 'module' attribute")
logger.debug(f"Instantiating provider {provider.provider_id} from {provider_spec.module}")