File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace=$(echo "$json" | jq -r '.metadata.namespace')
66kind=$( echo " $json " | jq -r ' .kind' )
77secret=$( echo " $json " | jq -r ' .spec.secret.name' )
88read=$( echo " $json " | jq -r ' .spec.service.read' )
9- write=$( echo " $json " | jq -r ' .spec.service.read ' )
9+ write=$( echo " $json " | jq -r ' .spec.service.write ' )
1010echo " ${namespace} /${name} object is added"
1111echo " ${namespace} /${secret} is target secret"
1212echo " ${read} is read service"
@@ -31,7 +31,7 @@ if [[ "$?" == "1" ]] ; then
3131 isDatabaseFree=$( kubectl get configmap redis-database-assignment-operator-in-use-dbs-list -o json | jq -r ' .data.dbs' | jq " .[\" ${write} \" ].db${i} " | grep free | wc -l)
3232 if [[ " $isDatabaseFree " == " 1" ]] ; then
3333 echo " Database ${i} is available"
34- kubectl create secret generic " ${secret} " -n " ${namespace} " --from-literal=database=" ${i} " --from-literal=read=" ${read} " --from-literal=write=" ${write} "
34+ kubectl create secret generic " ${secret} " -n " ${namespace} " --from-literal=database=" ${i} " --from-literal=read=" ${read}${i} " --from-literal=write=" ${write}${i } "
3535 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 " . * {\" ${write} \" : {\" db${i} \" : \" ${namespace} /${secret} \" }}" | jq -c) --dry-run -o yaml | kubectl apply -f -
3636 echo " Database ${i} has now been claimed"
3737 break
You can’t perform that action at this time.
0 commit comments