From 065b641d1ca25bcf2c64292a9ff75bdbef1f0e4d Mon Sep 17 00:00:00 2001
From: Alexandre MERLIN <alexandre.merlin@inria.fr>
Date: Thu, 20 Jan 2022 14:40:00 +0100
Subject: [PATCH] [karight] allow karight to be used in nodes with different
 archs

---
 lib/kadeploy3/client/client.rb | 2 +-
 sbin/karights3                 | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/kadeploy3/client/client.rb b/lib/kadeploy3/client/client.rb
index c6e29bab..7280ce77 100644
--- a/lib/kadeploy3/client/client.rb
+++ b/lib/kadeploy3/client/client.rb
@@ -873,7 +873,7 @@ class Client
     # Check that every nodes was treated
     error("The nodes #{(options[:nodes] - treated).join(", ")} does not belongs to any server") if options[:nodes] and treated.sort != options[:nodes].sort
 
-    unless options[:env_arch] || nodes.nil?
+    unless options[:env_arch] || nodes.nil? || options[:command] == 'karight' # karight can be apply on node with different arch
       default_arch.uniq!
       error("Selected nodes have a different default architecture. You must specify the architecture to use with --env-arch.") if default_arch.count != 1
       options[:env_arch] = default_arch.first
diff --git a/sbin/karights3 b/sbin/karights3
index 0e8ae22c..ca4d9990 100755
--- a/sbin/karights3
+++ b/sbin/karights3
@@ -32,6 +32,7 @@ class KarightsClient < Client
         :user => nil,
         :parts => [],
         :overwrite => false,
+        :command => 'karight',
         :json => false,
       }
     )
-- 
GitLab