Skip to content

Commit

Permalink
Merge pull request #28 from WyriHaximusNet/better-disabled-CONFIG-com…
Browse files Browse the repository at this point in the history
…mand-detection-and-fallback-to-default-16-databases

Better disbaled CONFIG command detection and fallback to 16 databases
  • Loading branch information
WyriHaximus authored Oct 15, 2022
2 parents 3337a08 + 312bb5a commit 3dff3f6
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) || echo "16")
maxDatabases=$(((redis-cli -u "${write}" CONFIG GET databases | grep -v databases) | grep -q "ERR" && echo "16") || (redis-cli -u "${write}" CONFIG GET databases | grep -v databases))
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 3dff3f6

Please sign in to comment.