Browse Source

new: [mongo] allow upgrading by maintaining compatibility version at current version.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/29/head
Valentin Lab 2 years ago
parent
commit
e148ac5787
  1. 16
      mongo/hooks/mongo_database-relation-joined

16
mongo/hooks/mongo_database-relation-joined

@ -88,3 +88,19 @@ else
exit 14 exit 14
fi fi
major_version=${version%.*}
## XXXvlab: why don't we do this initialisation in init ?
cmd="db.adminCommand( { setFeatureCompatibilityVersion: \"${major_version}\" } )"
debug "${WHITE}running:$NORMAL $cmd"
out=$(ddb < <(echo "use $DBNAME";
echo "$cmd"))
if [[ "$out" == *"\"ok\" : 1"* ]]; then
info "Feature Compatibility set to ${major_version}. "
else
err "Failed to set feature compatibieplicaSet initialisation failed:"
echo "$out" | prefix " | " >&2
exit 13
fi
Loading…
Cancel
Save