Skip to content
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

Tidy up ReloadableObjectFromJson._fetch_inspect_result_json() #536

Merged

Conversation

LewisGaul
Copy link
Collaborator

@LewisGaul LewisGaul commented Jan 15, 2024

The ReloadableObjectFromJson._fetch_inspect_result_json() method implemented for each component is now expected to return an object loaded from JSON, rather than expecting the result from <ctr_exe> <subcmd> inspect to always be a list.

This allows removing the hack in python_on_whales/components/manifest/cli_wrapper.py (and avoids having to do similar for podman pod inspect), which looked like:

    def _fetch_inspect_result_json(self, reference):
        return f'[{run(self.docker_cmd + ["manifest", "inspect", reference])}]'

Copy link
Owner

@gabrieldemarmiesse gabrieldemarmiesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very good change, indeed the previous implementation was hacky.

@gabrieldemarmiesse gabrieldemarmiesse merged commit f2eb701 into gabrieldemarmiesse:master Jan 16, 2024
35 checks passed
@LewisGaul LewisGaul deleted the inspect-tidyup branch January 16, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants