Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,38 @@ TAG=${TAG:-latest}

LVM_DISK="/var/lib/microshift-okd/lvmdisk.image"
VG_NAME="myvg1"
PODMAN_VMAJOR=4

function check_prerequisites() {
Comment thread
ggiguash marked this conversation as resolved.
for tool in "$@"; do
if ! command -v "${tool}" &>/dev/null; then
echo "ERROR: '${tool}' is not installed."
echo "Install it with:"
if command -v dnf &>/dev/null; then
echo " sudo dnf install -y ${tool}"
elif command -v apt-get &>/dev/null; then
echo " sudo apt-get install -y ${tool}"
elif command -v zypper &>/dev/null; then
echo " sudo zypper install -y ${tool}"
else
echo " Install '${tool}' using your system package manager"
fi
exit 1
fi
done
}

function check_podman_version() {
local podman_version
podman_version="$(podman --version | awk '/^podman version /{print $3}')"
local podman_major
podman_major="$(echo "${podman_version}" | cut -d. -f1)"
if [ -z "${podman_major}" ] || [ "${podman_major}" -lt "${PODMAN_VMAJOR}" ]; then
echo "ERROR: podman ${podman_version:-unknown} is too old (minimum required: ${PODMAN_VMAJOR}.0)"
echo "Please upgrade podman and try again."
exit 1
Comment thread
mmahut marked this conversation as resolved.
fi
Comment thread
ggiguash marked this conversation as resolved.
}

function pull_bootc_image() {
local -r image_ref="$1"
Expand Down Expand Up @@ -109,8 +141,12 @@ if [ "$(id -u)" -ne 0 ]; then
exit 1
fi

check_prerequisites podman
check_podman_version

# For remote images with the 'latest' tag, update the tag to the latest released version
if [[ "${IMAGE}" != localhost/* ]] && [ "${TAG}" == "latest" ]; then
check_prerequisites curl jq
TAG="$(curl -s --max-time 60 "https://api.github.com/repos/${OWNER}/${REPO}/releases/latest" | jq -r .tag_name)"
if [ -z "${TAG}" ] || [ "${TAG}" == "null" ] ; then
echo "ERROR: Could not determine the latest release tag from GitHub"
Expand Down
Loading