omni/hack/test/vm-common.sh
Utku Ozdemir 0c2c5c1cc3
test: use envsubst in tests and do small improvements
Now that we have envsubst in the build container, we can simplify our scripts a bit.

Also do other cosmetic improvements in the test scripts.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2026-02-16 11:04:25 +01:00

23 lines
521 B
Bash

#!/usr/bin/env bash
# Copyright (c) 2026 Sidero Labs, Inc.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file.
# Find the cluster directory containing the given machine.
# Usage: dir=$(find_machine_dir "$machine_name")
find_machine_dir() {
local machine="$1"
for d in "${HOME}/.talos/clusters"/*; do
if [[ -e "${d}/machine-${machine}.monitor" ]]; then
echo "${d}"
return
fi
done
echo "Error: machine '${machine}' not found" >&2
return 1
}