[libvirt PATCH 11/11] ci: helper: Perform some validation on containers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This reports a nice error messages when the user attempts
to perform a cross-build on a target that doesn't support it,
or to use a target that doesn't exist at all.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 ci/helper | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ci/helper b/ci/helper
index cd3069a89a..d5bdb15112 100755
--- a/ci/helper
+++ b/ci/helper
@@ -191,10 +191,19 @@ class Application:
             sys.exit("error: 'make' failed")
 
     def _make_run_action(self, action):
+        registry_uri = util.get_registry_uri(self._args.namespace,
+                                             self._args.gitlab_uri)
+        images = util.get_registry_images(registry_uri)
         target = self._args.target
         cross = self._args.cross_arch
 
+        if target not in images:
+            sys.exit(f"Unknown target '{target}'")
+
         if cross:
+            if cross not in images[target]:
+                sys.exit(f"Target '{target}' doesn't support cross '{cross}'")
+
             make_target = f"{action}@{target}-cross-{cross}"
         else:
             make_target = f"{action}@{target}"
-- 
2.26.3




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux