Open LewisGaul opened 7 months ago
Doing a docker.image.inspect()
has a runtime cost. If we do it, we'll need to use the lazy loading features of python-on-whales.
I'll need to think about it, there are qui a few area that this can affect, because we could argue that the same could be done for volumes, networks, etc
The
Container.image
property is a string representing the image ID, rather than anImage
instance. This is consistent with all fields of inspect output, which is simply parsed via pydantic, however in the case of the field being a simple ID we could use this to construct a python-on-whales object for the user's convenience.The problem is backwards compatibility... Perhaps something for v1.0?
The same consideration exists for the new
Container.pod
andPod.containers
properties, see https://github.com/LewisGaul/python-on-whales/pull/4/commits/6ffcf45813006e90377f3054495ec16dfd879276.