Skip to content

Commit

Permalink
Revert "feat(script/env_check): check overriden NFS version"
Browse files Browse the repository at this point in the history
The env check script is deprecated and will be removed soon. Reverts
commit c0b5f2a.

Signed-off-by: Raphanus Lo <yunchang.lo@suse.com>
  • Loading branch information
COLDTURNIP authored and derekbit committed Dec 12, 2024
1 parent b91f0ba commit 64afdec
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions scripts/environment_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ check_nfs_client() {
return 1
fi

local nfs_module_not_found=1
for option in "${options[@]}"; do
kubectl exec ${pod} -- nsenter --mount=/proc/1/ns/mnt -- bash -c "[ -f /boot/config-${kernel} ]" > /dev/null 2>&1
if [ $? -ne 0 ]; then
Expand All @@ -397,27 +396,13 @@ check_nfs_client() {
fi

check_kernel_module ${pod} ${option} nfs
nfs_module_not_found=$?
if [ $nfs_module_not_found = 0 ]; then
break
if [ $? = 0 ]; then
return 0
fi
done

if [ $nfs_module_not_found -ne 0 ]; then
error "NFS clients ${options[*]} not found. At least one should be enabled"
return 1
fi

local nfs_ver_overriden=$(kubectl exec ${pod} -- nsenter --mount=/proc/1/ns/mnt -- bash -c "grep '^\s*Defaultvers=' /etc/nfsmount.conf" 2> /dev/null)
if [ "$nfs_ver_overriden" ]; then
echo "$nfs_ver_overriden" | grep -x '.*Defaultvers=4\(\.[0-2]\?\)\?\s*'
if [ $? -ne 0 ]; then
error "NFS4 is supported, but default protocol version (${nfs_ver_overriden}) is not 4, 4.1, or 4.2. Please refer to the NFS mount configuration manual page for more information: man 5 nfsmount.conf"
return 1
fi
fi

return 0
error "NFS clients ${options[*]} not found. At least one should be enabled"
return 1
}

check_kernel_module() {
Expand Down

0 comments on commit 64afdec

Please sign in to comment.