Skip to content

Commit

Permalink
Avoid installing yq twice
Browse files Browse the repository at this point in the history
Also install it early and pin its version
  • Loading branch information
elfosardo committed Jun 21, 2024
1 parent c7a4ac3 commit 65c1377
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions 01_install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,19 @@ case $DISTRO in
;;
esac

# We use yq in a few places for processing YAML but it isn't packaged
# for CentOS/RHEL so we have to install from pip. We do not want to
# overwrite an existing installation of the golang version, though,
# so check if we have a yq before installing.
if ! which yq 2>&1 >/dev/null; then
sudo python -m pip install 'yq>=3,<4'
else
echo "Using yq from $(which yq)"
fi

# Hijack metal3-dev-env update module to use nobest
# during dnf upgrade
sudo dnf -y install jq
sudo python -m pip install yq
yq -iy '.[3].dnf.nobest = "true"' ${METAL3_DEV_ENV_PATH}/vm-setup/roles/packages_installation/tasks/centos_required_packages.yml

GO_VERSION=${GO_VERSION:-1.22.3}
Expand Down Expand Up @@ -146,16 +155,6 @@ if [[ "${NODES_PLATFORM}" == "baremetal" ]] ; then
sudo dnf -y install ipmitool
fi

# We use yq in a few places for processing YAML but it isn't packaged
# for CentOS/RHEL so we have to install from pip. We do not want to
# overwrite an existing installation of the golang version, though,
# so check if we have a yq before installing.
if ! which yq 2>&1 >/dev/null; then
sudo python -m pip install 'yq>=2.10.0'
else
echo "Using yq from $(which yq)"
fi

# needed if we are using locally built images
# We stop any systemd service so we can run in a container, since
# there's no RPM/systemd version available for RHEL8
Expand Down

0 comments on commit 65c1377

Please sign in to comment.