nvidia: run advertise-gpumem provisioner under bash (dash rejects pipefail)

First apply of ADR-0016 failed: terraform local-exec defaults to /bin/sh,
which on Ubuntu is dash — 'set -euo pipefail' exits 2 before running kubectl.
Pin the interpreter to bash. Everything else in the gpumem apply succeeded.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Viktor Barzin 2026-07-02 05:21:47 +00:00
parent 968b2b9c64
commit ac41e7c017

View file

@ -57,7 +57,9 @@ locals {
# unschedulable (extended resource not advertised by any node).
resource "null_resource" "advertise_gpumem" {
provisioner "local-exec" {
command = <<-EOT
# bash, not the default /bin/sh: dash (Ubuntu sh) rejects `set -o pipefail`
interpreter = ["/bin/bash", "-c"]
command = <<-EOT
set -euo pipefail
for node in $(kubectl get nodes -l nvidia.com/gpu.present=true -o jsonpath='{.items[*].metadata.name}'); do
echo "advertising ${var.gpumem_resource}=${var.gpumem_total_mib} on $node"