chore: fix oci disable bug in install-dynamic-plugins.py#4576
chore: fix oci disable bug in install-dynamic-plugins.py#4576Zaperex wants to merge 4 commits intoredhat-developer:mainfrom
Conversation
Assisted-By: Cursor Signed-off-by: Frank Kong <frkong@redhat.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
8dba13a to
3178310
Compare
|
The container image build workflow finished with status: |
| return | ||
| match = re.match(OciPackageMerger.EXPECTED_OCI_PATTERN, package) | ||
| if not match: | ||
| raise InstallException(f"oci package \'{package}\' is not in the expected format \'{OCI_PROTOCOL_PREFIX}<registry>:<tag>\' or \'{OCI_PROTOCOL_PREFIX}<registry>@<algo>:<digest>\' (optionally followed by \'!<path>\') in {source_file} where <registry> may include a port (e.g. host:5000/path) and <algo> is one of {RECOGNIZED_ALGORITHMS}") |
There was a problem hiding this comment.
Wondering why we need to validate this.. IMO we should just skip any kind of validation for a package ref when disabled is true, no? Users may purposely want to disable the plugin definition completely (rather than commenting it out), even if the definition is invalid.
There was a problem hiding this comment.
Hmm I guess that makes sense, but this is more for the general case for matching with entries that already exist in an includes file, which means we would need a consistent format for the package field to be able to properly match plugins to merge their disabled states.
There was a problem hiding this comment.
I see. How about skipping invalid entries that are disabled with just a warning? That way, if someone has an invalid disabled entry in their dynamic-plugins config but a valid enabled entry in an includes file, the valid one won't be disabled (as I guess there would be no matching here, but this is fine IMO). The warning on the invalid one would help users know something might be misconfigured. Would that make sense?
I was commenting on this specific package format validation error, but noticed there is also other InstallException raised in https://github.com/Zaperex/rhdh/blob/3178310b2e593c0b5ab187711dcc57c91626933a/scripts/install-dynamic-plugins/install-dynamic-plugins.py#L1204-L1209
These validations are all fine when the package is enabled, but should not block the init container on disabled plugins IMO.
|
/cherry-pick release-1.9 |
|
@rm3l: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: Frank Kong <frkong@redhat.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
|
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|



Description
Added a pre-merge step to disable annotation fetch for metadata for disabled plugins without an explicitly defined plugin path
Which issue(s) does this PR fix
PR acceptance criteria
Please make sure that the following steps are complete:
How to test changes / Special notes to the reviewer