From 86853f4a3ee5b439ad41e1ba30b0a4efbae28025 Mon Sep 17 00:00:00 2001 From: Xyphuz Date: Wed, 18 May 2022 16:40:20 +0800 Subject: [PATCH] feat: implement infeasible service initialization --- compose_viz/service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compose_viz/service.py b/compose_viz/service.py index f1da6a8..feaaf53 100644 --- a/compose_viz/service.py +++ b/compose_viz/service.py @@ -10,6 +10,9 @@ class Service: if image is None and extends is None: 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._ports = ports self._networks = networks