Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#896 from tydra-wang/fix-efc-install
Browse files Browse the repository at this point in the history
fix host_os detection
  • Loading branch information
k8s-ci-robot authored Oct 20, 2023
2 parents cd3a0de + 4018668 commit dd35f04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
7 changes: 2 additions & 5 deletions build/lib/amd64-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ mkdir -p /host/etc/kubernetes/volumes/disk/uuid

HOST_CMD="/nsenter --mount=/proc/1/ns/mnt"


host_os="centos"
${HOST_CMD} ls /etc/os-release
os_release_exist=$?

if [[ "$os_release_exist" = "0" ]]; then
osID=`${HOST_CMD} cat /etc/os-release | grep "ID=" | grep -v "VERSION_ID"`
if [[ `echo ${osID} | grep "alinux" | wc -l` != "0" ]]; then
osVersion=`${HOST_CMD} cat /etc/os-release | grep "VERSION_ID=" | grep "^VERSION_ID=\"3"`
if [[ "${osVersion}" ]]; then
host_os="alinux3"
fi
host_os="alinux$(eval $($HOST_CMD cat /etc/os-release); echo ${VERSION_ID} | cut -d'.' -f1)"
fi
if [[ `echo ${osID} | grep "lifsea" | wc -l` != "0" ]]; then
host_os="lifsea"
Expand All @@ -32,6 +28,7 @@ if [[ "$os_release_exist" = "0" ]]; then
fi
fi
fi
echo "detected host os: $host_os"

## check which plugin is running
for item in $@;
Expand Down
7 changes: 3 additions & 4 deletions build/multi-private/amd64-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ os_release_exist=$?
if [[ "$os_release_exist" = "0" ]]; then
osID=`${HOST_CMD} cat /etc/os-release | grep "ID=" | grep -v "VERSION_ID"`
if [[ `echo ${osID} | grep "alinux" | wc -l` != "0" ]]; then
osVersion=`${HOST_CMD} cat /etc/os-release | grep "VERSION_ID=" | grep "^VERSION_ID=\"3"`
if [[ "${osVersion}" ]]; then
host_os="alinux3"
fi
host_os="alinux$(eval $($HOST_CMD cat /etc/os-release); echo ${VERSION_ID} | cut -d'.' -f1)"
fi
if [[ `echo ${osID} | grep "kylin" | wc -l` != "0" ]]; then
host_os="kylin"
Expand All @@ -38,6 +35,8 @@ if [[ "$os_release_exist" = "0" ]]; then
fi
fi

echo "detected host os: $host_os"

## check which plugin is running
for item in $@;
do
Expand Down
7 changes: 3 additions & 4 deletions build/multi-private/arm64-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ os_release_exist=$?
if [[ "$os_release_exist" = "0" ]]; then
osID=`${HOST_CMD} cat /etc/os-release | grep "ID=" | grep -v "VERSION_ID"`
if [[ `echo ${osID} | grep "alinux" | wc -l` != "0" ]]; then
osVersion=`${HOST_CMD} cat /etc/os-release | grep "VERSION_ID=" | grep "^VERSION_ID=\"3"`
if [[ "${osVersion}" ]]; then
host_os="alinux3"
fi
host_os="alinux$(eval $($HOST_CMD cat /etc/os-release); echo ${VERSION_ID} | cut -d'.' -f1)"
fi
if [[ `echo ${osID} | grep "kylin" | wc -l` != "0" ]]; then
host_os="kylin"
Expand All @@ -43,6 +40,8 @@ if [[ "$os_release_exist" = "0" ]]; then
fi
fi

echo "detected host os: $host_os"

#update oss file in kylin/uos
ossPath=/usr/bin/ossfs
if [[ ${host_os} == "kylin" ]] || [[ ${host_os} == "uos" ]] || [[ ${host_os} == "anolis8" ]] || [[ ${host_os} == "alinux3" ]]; then
Expand Down

0 comments on commit dd35f04

Please sign in to comment.