-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify post-refresh hook to set OSD-release
Signed-off-by: Luciano Lo Giudice <[email protected]>
- Loading branch information
Showing
1 changed file
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |