Skip to content

Commit

Permalink
Default to 16 databases when we can't retrieve it for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus authored Oct 9, 2022
1 parent 86a1c03 commit 8413b13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engine/add.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ echo "${write} is write service"

(kubectl get secret -n "${namespace}" "${secret}")
if [[ "$?" == "1" ]] ; then
maxDatabases=$(redis-cli -u "${write}" CONFIG GET databases | grep -v databases)
maxDatabases=$((redis-cli -u "${write}" CONFIG GET databases | grep -v databases) || 16)
redisServerIsKnown=$(kubectl get configmap redis-database-assignment-operator-in-use-dbs-list -o json | jq -r -c '.data.dbs' | jq -r ".\"${uri_host_port}\"" | wc -l)
if [[ "$redisServerIsKnown" == "1" ]] ; then
kubectl create configmap redis-database-assignment-operator-in-use-dbs-list --from-literal=dbs=$(kubectl get configmap redis-database-assignment-operator-in-use-dbs-list -o json | jq -r '.data.dbs' | jq -r ". * {\"${uri_host_port}\": {}}" | jq -c) --dry-run -o yaml | kubectl apply -f -
Expand Down

0 comments on commit 8413b13

Please sign in to comment.