From 0d94b6e4cf4abc20a7f702ed5ab3f48c4f5405a8 Mon Sep 17 00:00:00 2001 From: Derek Su Date: Wed, 28 Jun 2023 11:05:03 +0800 Subject: [PATCH] spdk: help install git before configuring spdk environment Signed-off-by: Derek Su --- deploy/prerequisite/longhorn-spdk-setup.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/prerequisite/longhorn-spdk-setup.yaml b/deploy/prerequisite/longhorn-spdk-setup.yaml index 0369218..6f6d7a9 100644 --- a/deploy/prerequisite/longhorn-spdk-setup.yaml +++ b/deploy/prerequisite/longhorn-spdk-setup.yaml @@ -5,7 +5,7 @@ metadata: labels: app: longhorn-spdk-setup annotations: - command: &cmd rm -rf ${SPDK_DIR}; git clone -b longhorn https://github.com/longhorn/spdk.git ${SPDK_DIR} && bash ${SPDK_DIR}/scripts/setup.sh ${SPDK_OPTION}; if [ $? -eq 0 ]; then echo "vm.nr_hugepages=$((HUGEMEM/2))" >> /etc/sysctl.conf; echo "SPDK environment is configured successfully"; else echo "Failed to configure SPDK environment error code $?"; fi; rm -rf ${SPDK_DIR} + command: &cmd OS=$(grep -E "^ID_LIKE=" /etc/os-release | cut -d '=' -f 2); if [[ -z "${OS}" ]]; then OS=$(grep -E "^ID=" /etc/os-release | cut -d '=' -f 2); fi; if [[ "${OS}" == *"debian"* ]]; then sudo apt-get update -q -y && sudo apt-get install -q -y git; elif [[ "${OS}" == *"suse"* ]]; then sudo zypper --gpg-auto-import-keys -q refresh && sudo zypper --gpg-auto-import-keys -q install -y git; else sudo yum makecache -q -y && sudo yum --setopt=tsflags=noscripts install -q -y git; fi && if [ $? -eq 0 ]; then echo "git install successfully"; else echo "git install failed error code $?"; fi && rm -rf ${SPDK_DIR}; git clone -b longhorn https://github.com/longhorn/spdk.git ${SPDK_DIR} && bash ${SPDK_DIR}/scripts/setup.sh ${SPDK_OPTION}; if [ $? -eq 0 ]; then echo "vm.nr_hugepages=$((HUGEMEM/2))" >> /etc/sysctl.conf; echo "SPDK environment is configured successfully"; else echo "Failed to configure SPDK environment error code $?"; fi; rm -rf ${SPDK_DIR} spec: selector: matchLabels: