Check if Gitaly is attached to NFS shares
We should add a check that detects if Gitaly is using NFS shares, as this is deprecated and is a major cause of performance issues https://docs.gitlab.com/update/deprecations/#nfs-for-git-repository-storage. To this day, I still see the odd customer running NFS with Gitaly even on current GitLab releases.
This snippet works for me and properly detects NFS shares Gitaly is using in Ubuntu Server, however I cannot for the life of me get it working with GitLab Detective and spot
:
Update: See #103 (comment 2479658895)
$(found_on_nfs=1;
mount | awk '/nfs/ {print $3}' | while IFS= read -r nfs_mount; do
toml_paths=$(awk '/^path = "/ {gsub(/^path = "/, ""); gsub(/"$/, ""); print $0}' /var/opt/gitlab/gitaly/config.toml);
for toml_path in $(echo "$toml_paths"); do
if [[ "$toml_path" == "$nfs_mount"* ]]; then
found_on_nfs=0;
break 2;
fi;
done;
done;
exit $found_on_nfs
)
Edited by Anton Smith