Skip to content

Commit 6ddc9ad

Browse files
committed
fix(setup): Ensure yq is on remote host
YQ is more necessary on the remote host than the local host that runs the hyperconverged-lab script, so warn about it not getting installed locally but fail if not present on the remote host.
1 parent fb47c09 commit 6ddc9ad

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

bin/install-keystone.sh

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,6 @@ fi
4242

4343
echo "Found version for $SERVICE_NAME_DEFAULT: $SERVICE_VERSION"
4444

45-
# Debug: Check yq availability before using it
46-
echo "=== YQ DEBUG INFO ==="
47-
echo "PATH: $PATH"
48-
if command -v yq &> /dev/null; then
49-
echo "yq found at: $(command -v yq)"
50-
echo "yq version: $(yq --version)"
51-
echo "====================="
52-
else
53-
echo "ERROR: yq command not found in PATH"
54-
echo "Checking common locations:"
55-
ls -la /usr/local/bin/yq 2>/dev/null || echo " /usr/local/bin/yq: not found"
56-
ls -la /usr/bin/yq 2>/dev/null || echo " /usr/bin/yq: not found"
57-
echo "====================="
58-
echo "Cannot continue without yq. Exiting."
59-
exit 1
60-
fi
61-
6245
# Load chart metadata from custom override YAML if defined
6346
for yaml_file in "${SERVICE_CUSTOM_OVERRIDES}"/*.yaml; do
6447
if [ -f "$yaml_file" ]; then

scripts/hyperconverged-lab.sh

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ RUN_EXTRAS=0
88
INCLUDE_LIST=()
99
EXCLUDE_LIST=()
1010

11+
# yq installation constants
12+
YQ_VERSION="v4.2.0"
13+
YQ_BINARY="yq_linux_amd64"
14+
1115
function installYq() {
12-
export VERSION=v4.2.0
13-
export BINARY=yq_linux_amd64
14-
if wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - | tar xz && sudo mv ${BINARY} /usr/local/bin/yq; then
15-
echo "Successfully installed yq version ${VERSION}"
16+
if wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY}.tar.gz -O - | tar xz && sudo mv ${YQ_BINARY} /usr/local/bin/yq; then
17+
echo "Successfully installed yq version ${YQ_VERSION}"
1618
return 0
1719
else
1820
echo "Failed to install yq"
@@ -24,8 +26,7 @@ function installYq() {
2426
if ! yq --version 2> /dev/null; then
2527
echo "yq is not installed. Attempting to install yq"
2628
if ! installYq; then
27-
echo "Unable to proceed without yq. Exiting."
28-
exit 1
29+
echo "[WARNING] Failed to install yq locally"
2930
fi
3031
fi
3132

@@ -437,6 +438,19 @@ if [ ! -d "/etc/genestack" ]; then
437438
sudo chown \${USER}:\${USER} -R /etc/genestack
438439
fi
439440
441+
# Install yq on the remote host if not already present
442+
if ! command -v yq &> /dev/null; then
443+
echo "Installing yq on remote host..."
444+
if wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY}.tar.gz -O - | tar xz && sudo mv ${YQ_BINARY} /usr/local/bin/yq; then
445+
echo "Successfully installed yq version ${YQ_VERSION} on remote host"
446+
else
447+
echo "Failed to install yq on remote host"
448+
exit 1
449+
fi
450+
else
451+
echo "yq already available on remote host: \$(yq --version)"
452+
fi
453+
440454
# We need to clobber the sample or else we get a bogus LB vip
441455
cat > /etc/genestack/manifests/metallb/metallb-openstack-service-lb.yml <<EOF
442456
---

0 commit comments

Comments
 (0)