From 08b1bed74c1300b09edf72759e6d6c698663fa2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= <valtri@civ.zcu.cz>
Date: Thu, 13 Feb 2025 17:46:38 +0000
Subject: [PATCH] Support the use-case without GPU nodes

---
 common/playbooks/k8s.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/playbooks/k8s.yaml b/common/playbooks/k8s.yaml
index a53ab7a..2a0ce76 100644
--- a/common/playbooks/k8s.yaml
+++ b/common/playbooks/k8s.yaml
@@ -607,9 +607,10 @@
         when: true
       - name: Get GPU node hostnames
         shell: |-
-          kubectl get nodes --no-headers -o custom-columns=NAME:.metadata.name | grep gpu
+          kubectl get nodes --no-headers -o custom-columns=NAME:.metadata.name | grep -- -gpu-
         register: gpu_nodes
-        changed_when: true
+        changed_when: false
+        failed_when: gpu_nodes.rc != 0 and gpu_nodes.rc != 1
         when: true
       - name: Print GPU node hostnames
         debug:
-- 
GitLab