From f1bc64a58e78779ab028b5ed3bc4387482355f3b Mon Sep 17 00:00:00 2001
From: Clark Boylan <clark.boylan@gmail.com>
Date: Wed, 19 Mar 2025 07:53:45 -0700
Subject: [PATCH] Fix nodepool image export cron

This is a followup to the prior fix that addressed the path issue. Now
we have the problem of docker-compose attempting to allocate a tty (the
default) which isn't possible by default under cron. We don't need a tty
so we pass -T to disable tty allocation in the first place.

I should've caught this the last time around but my testing didn't catch
it because I was running from a shell.

Change-Id: I57797c8d140335d9edcdcd324239fdefb09882d4
---
 playbooks/roles/nodepool-builder/tasks/main.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/playbooks/roles/nodepool-builder/tasks/main.yaml b/playbooks/roles/nodepool-builder/tasks/main.yaml
index a779e551c9..8eb9a02f1e 100644
--- a/playbooks/roles/nodepool-builder/tasks/main.yaml
+++ b/playbooks/roles/nodepool-builder/tasks/main.yaml
@@ -49,4 +49,4 @@
     hour: '{{ 23 | random(seed=inventory_hostname) }}'
     # Note we backup to /var/log/nodepool because that is what we have bind
     # mounted in the container and we are operating relative to that context
-    job: /usr/local/bin/docker-compose -f /etc/nodepool-builder-compose/docker-compose.yaml exec nodepool-builder nodepool export-image-data /var/log/nodepool/nodepool-image-backup.json
+    job: /usr/local/bin/docker-compose -f /etc/nodepool-builder-compose/docker-compose.yaml exec -T nodepool-builder nodepool export-image-data /var/log/nodepool/nodepool-image-backup.json