fix(image): use getattr for registry credentials to avoid AttributeError

- Use getattr with None defaults for registry auth arguments
- Credentials fall back to TRIVY_USERNAME/TRIVY_PASSWORD env vars in ImageProvider
This commit is contained in:
Andoni A.
2026-02-13 08:56:38 +01:00
parent 0589721505
commit 4af9bc99bf
+3 -3
View File
@@ -285,9 +285,9 @@ class Provider(ABC):
timeout=arguments.timeout,
config_path=arguments.config_file,
fixer_config=fixer_config,
registry_username=arguments.registry_username,
registry_password=arguments.registry_password,
registry_token=arguments.registry_token,
registry_username=getattr(arguments, "registry_username", None),
registry_password=getattr(arguments, "registry_password", None),
registry_token=getattr(arguments, "registry_token", None),
)
elif "mongodbatlas" in provider_class_name.lower():
provider_class(