-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IIB uses opm render #784
base: master
Are you sure you want to change the base?
IIB uses opm render #784
Conversation
[CLOUDDST-25207]
[CLOUDDST-25207]
[CLOUDDST-25207]
opm_render_output = run_cmd( | ||
cmd, {'cwd': base_dir}, exc_msg=f'Failed to list bundles on {input_data}' | ||
) | ||
|
||
if not opm_render_output: | ||
log.info("There are no bundles in %s", input_data) | ||
return [] | ||
|
||
log.debug("Parsing data from opm render") | ||
opm_data = [json.loads(package) for package in re.split(r'(?<=})\n(?={)', opm_render_output)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this piece of code is duplicated from get_list_packages
. Wouldn't make sense to have a private or lower level function just to do this and share the code between get_list_packages
and get_list_bundles
?
""" | ||
log.info('Serving data from file-based catalog %s', catalog_dir) | ||
olm_packages = [ | ||
json.loads(package) for package in re.split(r'(?<=})\n(?={)', opm_render_output) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity: Any specific reason we're splitting the content between brackets and then loading into json
? Couldn't we simply load the JSON list and parse its dictionaries?
We agreed to drop
opm serve
command and move toopm render
instead.This PR adds opm render and removes unused parts of code with opm serve.
[CLOUDDST-25207]