Skip to content

Commit

Permalink
Modify post-refresh hook to set OSD-release
Browse files Browse the repository at this point in the history
  • Loading branch information
lmlg committed Nov 8, 2024
1 parent e32ad49 commit beb44dc
Showing 1 changed file with 25 additions and 1 deletion.
1 change: 0 additions & 1 deletion snap/hooks/post-refresh

This file was deleted.

25 changes: 25 additions & 0 deletions snap/hooks/post-refresh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
set -uex
conf="${SNAP_DATA}/conf"
mkdir -p -m 0755 "${conf}"
cp "${SNAP}/share/metadata.yaml" "${conf}"

# Check if we need to set the osd-release option.
set +e
trap 'exit 0' ERR

versions=`microceph.ceph versions`
ov_len=echo $versions | jq '.["overall"] | length'
if [ $ov_len > 1 ]; then
echo "Not all nodes are running the same version"
exit 0
fi

osd_len=echo $versions | jq '.["osd"] | length'
if [ $osd_len < 1 ]; then
echo "No osd versions found"
exit 0
fi

new_version=`microceph.ceph -v` | awk '{print $5}'
microceph.ceph osd require-osd-release $new_version --yes-i-really-mean-it

0 comments on commit beb44dc

Please sign in to comment.