environment check: precisely check kernel option
Longhorn 3157 Signed-off-by: Derek Su <derek.su@suse.com>
This commit is contained in:
parent
c83497b685
commit
62998adab2
@ -318,19 +318,19 @@ check_nfs_client_kernel_support() {
|
||||
local nfs_client_kernel_configs=("CONFIG_NFS_V4_1" "CONFIG_NFS_V4_2")
|
||||
|
||||
for config in "${nfs_client_kernel_configs[@]}"; do
|
||||
declare -A nodes
|
||||
declare -A nodes=()
|
||||
|
||||
for pod in ${pods}; do
|
||||
node=`kubectl get ${pod} --no-headers -o=custom-columns=:.spec.nodeName`
|
||||
res=`kubectl exec -t $pod -- nsenter --mount=/proc/1/ns/mnt -- bash -c "grep -E \"^# ${config}\" /boot/config-$(uname -r)" > /dev/null 2>&1`
|
||||
res=`kubectl exec -t $pod -- nsenter --mount=/proc/1/ns/mnt -- bash -c "grep -E \"^# ${config} is not set\" /boot/config-$(uname -r)" > /dev/null 2>&1`
|
||||
if [[ $? == 0 ]]; then
|
||||
all_found=false
|
||||
nodes["${node}"]="${node}"
|
||||
else
|
||||
res=`kubectl exec -t $pod -- nsenter --mount=/proc/1/ns/mnt -- bash -c "grep -E ${config} /boot/config-$(uname -r)" > /dev/null 2>&1`
|
||||
res=`kubectl exec -t $pod -- nsenter --mount=/proc/1/ns/mnt -- bash -c "grep -E \"^${config}=\" /boot/config-$(uname -r)" > /dev/null 2>&1`
|
||||
if [[ $? != 0 ]]; then
|
||||
all_found=false
|
||||
warn "Unable to check kernel config ${config}"
|
||||
warn "Unable to check kernel config ${config} on node ${node}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user