gabrieldemarmiesse / python-on-whales

An awesome Python wrapper for an awesome Docker CLI!
MIT License
541 stars 101 forks source link

Tidy up `ReloadableObjectFromJson._fetch_inspect_result_json()` #536

Closed LewisGaul closed 8 months ago

LewisGaul commented 8 months ago

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])}]'