Check for file in ENABLED_PLUGINS#2045
Merged
Merged
Conversation
95c9226 to
da2aed2
Compare
evgeni
reviewed
Aug 13, 2025
|
|
||
| # pulp_container depends on pulp_file so if ENABLED_PLUGINS is used, it must be contained. | ||
| if ENABLED_PLUGINS := getattr(settings, "ENABLED_PLUGINS", None) is not None: | ||
| if "file" not in ENABLED_PLUGINS: |
da2aed2 to
115fb3a
Compare
evgeni
reviewed
Aug 13, 2025
115fb3a to
18a8ffe
Compare
Member
Author
|
That approach didn't work for me... |
Member
Author
|
And without buyin on the pulpcore side, i don't see that we can add validation for the settings. |
Member
|
Sorry, somehow I didn't see that before. So yeah, this should be validated in the settings, because the error is raised before those django checks. The easiest way is adding a dynaconf hook. --- /dev/null
+++ b/pulp_container/app/dynaconf_hooks.py
@@ -0,0 +1,10 @@
+# dynaconf_hooks.py
+from dynaconf import ValidationError
+
+
+def post(settings):
+ data = {"dynaconf_merge": True}
+ enabled_plugins = settings.get("ENABLED_PLUGINS")
+ if enabled_plugins and "pulp_file" not in enabled_plugins:
+ raise ValidationError("pulp_file must be enabled to use pulp_container")
+ return dataOr we could define some plugin config so plugins can declare which plugins they require, and let pulpcore validate it. |
0329f9e to
a320249
Compare
a320249 to
47c37df
Compare
fixes pulp#2044 Co-authored-by: Evgeni Golov <evgeni@golov.de> Co-authored-by: Pedro Brochado <pedropsb95@gmail.com>
47c37df to
b2fa1b3
Compare
Member
Author
|
I believe this works now. Thanks @pedro-psb |
pedro-psb
approved these changes
Sep 4, 2025
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.
No description provided.