fix(image): pass registry arguments through init_global_provider#10470
Merged
andoniaf merged 3 commits intoprowler-cloud:masterfrom Mar 30, 2026
Merged
fix(image): pass registry arguments through init_global_provider#10470andoniaf merged 3 commits intoprowler-cloud:masterfrom
andoniaf merged 3 commits intoprowler-cloud:masterfrom
Conversation
PR prowler-cloud#9985 added registry scan support with --registry, --image-filter, --tag-filter, --max-images, --registry-insecure, and --registry-list-images flags. PR prowler-cloud#10128 accidentally removed these kwargs from the init_global_provider call, so the CLI parsed them but never forwarded them to the ImageProvider constructor. This restores the six missing kwargs and adds a regression test.
Open
1 task
Contributor
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
Member
|
Closing and reopening to trigger CI approval flow for fork PR. Github is not having its best day... |
andoniaf
approved these changes
Mar 30, 2026
init_global_provider
init_global_provider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR resoles the corresponding issue: #10457
PR #9985 added registry scan support with --registry, --image-filter, --tag-filter, --max-images, --registry-insecure, and --registry-list-images flags. PR #10128 accidentally removed these kwargs from the init_global_provider call, so the CLI parsed them but never forwarded them to the ImageProvider constructor.
This restores the six missing kwargs and adds a regression test.
Please note, this is my first time contributing to Prowler, I have done my best to follow the guidelines from CONTRIBUTING.md.
Context
While deploying Prowler 5.22.0 as a weekly CronJob to scan my private OCI registry (blumeops), I discovered that
prowler image --registry <url>always fails withImageNoImagesProvidedError[11000]: No images provided for scanning, regardless of registry configuration.Root cause: PR #9985 (merged 2026-02-19) correctly added registry kwargs (
registry,image_filter,tag_filter,max_images,registry_insecure,registry_list_images) to theinit_global_providercall. PR #10128 (merged 2026-02-24) accidentally removed them — likely a merge conflict resolution that took the older version of theImageProviderconstructor call.My current workaround is an init container that enumerates images via the registry's
/v2/_catalogAPI and generates an--image-listfile, bypassing--registryentirely.Description
Restores the six missing registry-related kwargs to the
init_global_providercall for the image provider inprowler/providers/common/provider.py:registryimage_filtertag_filtermax_imagesregistry_insecureregistry_list_imagesThese are parsed by the CLI argument parser and accepted by
ImageProvider.__init__, but were not being forwarded between the two.Adds a regression test that exercises the full CLI-to-registry-enumeration path: it passes
--registryand--image-filterarguments throughinit_global_provider, mocks the registry adapter, and asserts that matching images are discovered and filtered correctly. This reproduces the exactImageNoImagesProvidedErrorwhen the fix is reverted.Steps to review
elif "image"block inprowler/providers/common/provider.pyagainstImageProvider.__init__signature inprowler/providers/image/image_provider.py. The six added kwargs match constructor parameters that were previously unreachable.pytest tests/providers/image/image_provider_test.py::TestInitGlobalProviderRegistryEnumeration -xvsprovider.pychange and re-run the test. It should fail withImageNoImagesProvidedError[11000]: No images provided for scanning.pytest tests/providers/image/image_provider_test.py. All 116 tests should pass.Checklist
Community Checklist
SDK/CLI
UI
N/A
API
N/A
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.