feat: implement infeasible service initialization

This commit is contained in:
Xyphuz 2022-05-18 16:40:20 +08:00
parent 83db62937c
commit 86853f4a3e

View file

@ -10,6 +10,9 @@ class Service:
if image is None and extends is None: if image is None and extends is None:
raise ValueError(f"Both image and extends are not defined in service '{name}', aborting.") raise ValueError(f"Both image and extends are not defined in service '{name}', aborting.")
if image is not None and extends is not None:
raise ValueError(f"Only one of image and extends can be defined in service '{name}', aborting.")
self._image = image self._image = image
self._ports = ports self._ports = ports
self._networks = networks self._networks = networks