Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gcp-local-ssd-raid] fix init script crash on subsequent restarts #318

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dysnix/gcp-local-ssd-raid/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: gcp-local-ssd-raid
description: A Helm chart for Kubernetes
version: 0.1.5
version: 0.1.6
appVersion: "0.1.0"

keywords:
Expand Down
12 changes: 9 additions & 3 deletions dysnix/gcp-local-ssd-raid/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ spec:
if ! test -e $raid_dev ; then
echo "$devs" | xargs /sbin/mdadm --create $raid_dev --level=0 --raid-devices=$(echo "$devs" | wc -l)
sudo mkfs.ext4 {{ .Values.localSsd.mkfsOpts }} -F $raid_dev
new_dev=$raid_dev
fi
new_dev=$raid_dev
else
if ! echo "$pvs" | grep volume_all_ssds ; then
echo "$devs" | xargs /sbin/pvcreate
Expand All @@ -153,7 +153,9 @@ spec:
new_dev=/dev/volume_all_ssds/logical_all_ssds
fi

if ! uuid=$(blkid -s UUID -o value $new_dev) ; then
uuid=$(blkid -s UUID -o value $new_dev)

if test -z "$uuid" ; then
mkfs.ext4 {{ .Values.localSsd.mkfsOpts }} $new_dev
uuid=$(blkid -s UUID -o value $new_dev)
fi
Expand All @@ -168,7 +170,11 @@ spec:
if ! grep "$uuid" /etc/fstab ; then
echo "UUID=$uuid $mnt_dir ext4 $mnt_opts" >> /etc/fstab
fi
mount -U "$uuid" -t ext4 --target "$mnt_dir" --options "$mnt_opts"

if ! findmnt -n -a -l --nofsroot | grep "$mnt_dir" ; then
mount -U "$uuid" -t ext4 --target "$mnt_dir" --options "$mnt_opts"
fi

chmod a+w "$mnt_dir"
containers:
- image: "quay.io/external_storage/local-volume-provisioner:v2.3.2"
Expand Down
Loading