Skip to content

K8SPS-265 add special characters #951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions build/orc-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ fi

set +o xtrace
temp=$(mktemp)
sed -r "s|^[#]?user=.*$|user=${TOPOLOGY_USER}|" "${ORC_CONF_PATH}/orc-topology.cnf" >"${temp}"
sed -r "s|^[#]?password=.*$|password=${TOPOLOGY_PASSWORD:-$ORC_TOPOLOGY_PASSWORD}|" "${ORC_CONF_PATH}/orc-topology.cnf" >"${temp}"
cat "${temp}" >"${ORC_CONF_PATH}/config/orc-topology.cnf"
ESCAPED_PASSWORD=$(printf '%s' "${TOPOLOGY_PASSWORD:-$ORC_TOPOLOGY_PASSWORD}" | sed -e 's/[&\]/\\&/g')
sed -r \
-e "s|^[#]?user=.*$|user=${TOPOLOGY_USER}|" \
-e "s|^[#]?password=.*$|password=${ESCAPED_PASSWORD}|" \
"${ORC_CONF_PATH}/orc-topology.cnf" > "${temp}"
Comment on lines +51 to +53
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
-e "s|^[#]?user=.*$|user=${TOPOLOGY_USER}|" \
-e "s|^[#]?password=.*$|password=${ESCAPED_PASSWORD}|" \
"${ORC_CONF_PATH}/orc-topology.cnf" > "${temp}"
-e "s|^[#]?user=.*$|user=${TOPOLOGY_USER}|" \
-e "s|^[#]?password=.*$|password=${ESCAPED_PASSWORD}|" \
"${ORC_CONF_PATH}/orc-topology.cnf" >"${temp}"

cat "${temp}" > "${ORC_CONF_PATH}/config/orc-topology.cnf"
rm "${temp}"
set -o xtrace

Expand Down
9 changes: 7 additions & 2 deletions build/router-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
OPERATOR_USER=${OPERATOR_USER:-operator}
NAMESPACE=$(</var/run/secrets/kubernetes.io/serviceaccount/namespace)

urlencode() {
python3 -c 'import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))' "$1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
python3 -c 'import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))' "$1"
python3 -c 'import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))' "$1"

}

if [ -f "/etc/mysql/mysql-users-secret/${OPERATOR_USER}" ]; then
OPERATOR_PASS=$(<"/etc/mysql/mysql-users-secret/${OPERATOR_USER}")
OPERATOR_PASS_ESCAPED=$(urlencode "$OPERATOR_PASS")
fi

mysqlrouter --force \
--bootstrap "${OPERATOR_USER}:${OPERATOR_PASS}@${MYSQL_SERVICE_NAME}-0.${MYSQL_SERVICE_NAME}.${NAMESPACE}.svc" \
--bootstrap "${OPERATOR_USER}:${OPERATOR_PASS_ESCAPED}@${MYSQL_SERVICE_NAME}-0.${MYSQL_SERVICE_NAME}.${NAMESPACE}.svc" \
--conf-bind-address 0.0.0.0 \
--conf-set-option http_auth_backend:default_auth_backend.backend=file \
--conf-set-option http_auth_backend:default_auth_backend.filename="${ROUTER_DIR}/realm.txt" \
--directory "${ROUTER_DIR}"

echo ${OPERATOR_PASS} | mysqlrouter_passwd set "${ROUTER_DIR}/realm.txt" ${OPERATOR_USER}
echo ${OPERATOR_PASS_ESCAPED} | mysqlrouter_passwd set "${ROUTER_DIR}/realm.txt" ${OPERATOR_USER}

Check notice on line 25 in build/router-entrypoint.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] build/router-entrypoint.sh#L25 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./build/router-entrypoint.sh:25:6: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 25 in build/router-entrypoint.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] build/router-entrypoint.sh#L25 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./build/router-entrypoint.sh:25:82: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

sed -i 's/logging_folder=.*/logging_folder=/g' "${ROUTER_DIR}/mysqlrouter.conf"
sed -i "/\[logger\]/a destination=/dev/stdout" "${ROUTER_DIR}/mysqlrouter.conf"
Expand Down
11 changes: 8 additions & 3 deletions build/router_readiness_check.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
#!/bin/bash

urlencode() {
python3 -c 'import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))' "$1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
python3 -c 'import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))' "$1"
python3 -c 'import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))' "$1"

}

OPERATOR_PASS=$(</etc/mysql/mysql-users-secret/operator)
OPERATOR_PASS_ESCAPED=$(urlencode "$OPERATOR_PASS")

if ! curl -k -s -u operator:"${OPERATOR_PASS}" https://localhost:8443/api/20190715/routes/bootstrap_rw/health | grep true; then
if ! curl -k -s -u operator:"${OPERATOR_PASS_ESCAPED}" https://localhost:8443/api/20190715/routes/bootstrap_rw/health | grep true; then
echo "Read-write route is not healthy"
exit 1
fi

if ! curl -k -s -u operator:"${OPERATOR_PASS}" https://localhost:8443/api/20190715/routes/bootstrap_ro/health | grep true; then
if ! curl -k -s -u operator:"${OPERATOR_PASS_ESCAPED}" https://localhost:8443/api/20190715/routes/bootstrap_ro/health | grep true; then
echo "Read-only route is not healthy"
exit 1
fi

exit 0
exit 0
9 changes: 7 additions & 2 deletions build/router_startup_check.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash

urlencode() {
python3 -c 'import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))' "$1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
python3 -c 'import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))' "$1"
python3 -c 'import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))' "$1"

}

OPERATOR_PASS=$(</etc/mysql/mysql-users-secret/operator)
OPERATOR_PASS_ESCAPED=$(urlencode "$OPERATOR_PASS")

if [[ $(curl -k -s -u operator:"${OPERATOR_PASS}" -o /dev/null -w %{http_code} https://localhost:8443/api/20190715/router/status) != 200 ]]; then
if [[ $(curl -k -s -u operator:"${OPERATOR_PASS_ESCAPED}" -o /dev/null -w %{http_code} https://localhost:8443/api/20190715/router/status) != 200 ]]; then

Check warning on line 10 in build/router_startup_check.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] build/router_startup_check.sh#L10 <ShellCheck.SC1083>

This { is literal. Check expression (missing ;/\n?) or quote it.
Raw output
./build/router_startup_check.sh:10:76: warning: This { is literal. Check expression (missing ;/\n?) or quote it. (ShellCheck.SC1083)

Check warning on line 10 in build/router_startup_check.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] build/router_startup_check.sh#L10 <ShellCheck.SC1083>

This } is literal. Check expression (missing ;/\n?) or quote it.
Raw output
./build/router_startup_check.sh:10:86: warning: This } is literal. Check expression (missing ;/\n?) or quote it. (ShellCheck.SC1083)
echo "Router is not ready"
fi
fi
4 changes: 3 additions & 1 deletion cmd/bootstrap/group_replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io"
"log"
"net/url"
"os"
"os/exec"
"regexp"
Expand Down Expand Up @@ -54,8 +55,9 @@ func (m *mysqlsh) getURI() string {
if err != nil {
return ""
}
escapedPass := url.QueryEscape(operatorPass)

return fmt.Sprintf("%s:%s@%s", apiv1alpha1.UserOperator, operatorPass, m.host)
return fmt.Sprintf("%s:%s@%s", apiv1alpha1.UserOperator, escapedPass, m.host)
}

func (m *mysqlsh) run(ctx context.Context, cmd string) (bytes.Buffer, bytes.Buffer, error) {
Expand Down
1 change: 0 additions & 1 deletion e2e-tests/conf/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ stringData:
root: root_password
xtrabackup: backup_password
monitor: monitor_password
proxyadmin: admin_password
operator: operator_password
replication: replication_password
orchestrator: orchestrator_password
Expand Down
5 changes: 5 additions & 0 deletions e2e-tests/functions
Original file line number Diff line number Diff line change
Expand Up @@ -1038,3 +1038,8 @@ deploy_cmctl() {
| kubectl apply -n "${NAMESPACE}" -f -
kubectl apply -n "${NAMESPACE}" -f "${TESTS_CONFIG_DIR}/cmctl.yml"
}

get_user_pass() {
local user="${1:-root}"
kubectl -n "${NAMESPACE}" get secret test-secrets -o jsonpath="{.data.${user}}" | base64 --decode
Comment on lines +1043 to +1044
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
local user="${1:-root}"
kubectl -n "${NAMESPACE}" get secret test-secrets -o jsonpath="{.data.${user}}" | base64 --decode
local user="${1:-root}"
kubectl -n "${NAMESPACE}" get secret test-secrets -o jsonpath="{.data.${user}}" | base64 --decode

}
1 change: 0 additions & 1 deletion e2e-tests/tests/demand-backup/01-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ commands:
apply_s3_storage_secrets
deploy_operator
deploy_non_tls_cluster_secrets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we are removing this cause the operator does not trigger the password generation if the key/value pair exists, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I want operator generate random passwords and we use it in our tests. (now we use passwords from predefined file and it's like root_password )

deploy_tls_cluster_secrets
deploy_client
deploy_minio
Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/tests/demand-backup/03-write-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ commands:
set -o xtrace

source ../../functions

password=$(get_user_pass root)
run_mysql \
"CREATE DATABASE IF NOT EXISTS myDB; CREATE TABLE IF NOT EXISTS myDB.myTable (id int PRIMARY KEY)" \
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -proot_password"
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -p'$password'"

run_mysql \
"INSERT myDB.myTable (id) VALUES (100500)" \
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -proot_password"
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -p'$password'"
6 changes: 3 additions & 3 deletions e2e-tests/tests/demand-backup/07-delete-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ commands:
set -o xtrace

source ../../functions

password=$(get_user_pass root)
run_mysql \
"TRUNCATE TABLE myDB.myTable" \
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -proot_password"
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -p'$password'"

cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 04-delete-data-minio-${i} --from-literal=data="${data}"
done
3 changes: 2 additions & 1 deletion e2e-tests/tests/demand-backup/10-read-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ commands:

source ../../functions

password=$(get_user_pass root)
cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 06-read-data-minio-${i} --from-literal=data="${data}"
done
5 changes: 3 additions & 2 deletions e2e-tests/tests/demand-backup/11-delete-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ commands:

source ../../functions

password=$(get_user_pass root)
run_mysql \
"TRUNCATE TABLE myDB.myTable" \
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -proot_password"
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -p'$password'"

cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 04-delete-data-minio-backup-source-${i} --from-literal=data="${data}"
done
3 changes: 2 additions & 1 deletion e2e-tests/tests/demand-backup/13-read-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ commands:

source ../../functions

password=$(get_user_pass root)
cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 09-read-data-minio-backup-source-${i} --from-literal=data="${data}"
done
5 changes: 3 additions & 2 deletions e2e-tests/tests/demand-backup/15-delete-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ commands:

source ../../functions

password=$(get_user_pass root)
run_mysql \
"TRUNCATE TABLE myDB.myTable" \
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -proot_password"
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -p'$password'"

cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 08-delete-data-s3-${i} --from-literal=data="${data}"
done
3 changes: 2 additions & 1 deletion e2e-tests/tests/demand-backup/17-read-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ commands:

source ../../functions

password=$(get_user_pass root)
cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 06-read-data-s3-${i} --from-literal=data="${data}"
done
5 changes: 3 additions & 2 deletions e2e-tests/tests/demand-backup/19-delete-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ commands:

source ../../functions

password=$(get_user_pass root)
run_mysql \
"TRUNCATE TABLE myDB.myTable" \
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -proot_password"
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -p'$password'"

cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 12-delete-data-gcp-${i} --from-literal=data="${data}"
done
3 changes: 2 additions & 1 deletion e2e-tests/tests/demand-backup/21-read-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ commands:

source ../../functions

password=$(get_user_pass root)
cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 06-read-data-gcp-${i} --from-literal=data="${data}"
done
5 changes: 3 additions & 2 deletions e2e-tests/tests/demand-backup/23-delete-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ commands:

source ../../functions

password=$(get_user_pass root)
run_mysql \
"TRUNCATE TABLE myDB.myTable" \
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -proot_password"
"-h $(get_haproxy_svc $(get_cluster_name)) -uroot -p'$password'"

cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 16-delete-data-azure-${i} --from-literal=data="${data}"
done
3 changes: 2 additions & 1 deletion e2e-tests/tests/demand-backup/25-read-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ commands:

source ../../functions

password=$(get_user_pass root)
cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 06-read-data-azure-${i} --from-literal=data="${data}"
done
1 change: 0 additions & 1 deletion e2e-tests/tests/gr-demand-backup/01-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ commands:
apply_s3_storage_secrets
deploy_operator
deploy_non_tls_cluster_secrets
deploy_tls_cluster_secrets
deploy_client
deploy_minio
Expand Down
5 changes: 3 additions & 2 deletions e2e-tests/tests/gr-demand-backup/03-write-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ commands:
source ../../functions
password=$(get_user_pass root)
run_mysql \
"CREATE DATABASE IF NOT EXISTS myDB; CREATE TABLE IF NOT EXISTS myDB.myTable (id int PRIMARY KEY)" \
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -proot_password"
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -p'$password'"
run_mysql \
"INSERT myDB.myTable (id) VALUES (100500)" \
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -proot_password"
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -p'$password'"
5 changes: 3 additions & 2 deletions e2e-tests/tests/gr-demand-backup/05-delete-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ commands:

source ../../functions

password=$(get_user_pass root)
run_mysql \
"TRUNCATE TABLE myDB.myTable" \
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -proot_password"
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -p'$password'"

cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 04-delete-data-minio-${i} --from-literal=data="${data}"
done
3 changes: 2 additions & 1 deletion e2e-tests/tests/gr-demand-backup/07-read-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ commands:

source ../../functions

password=$(get_user_pass root)
cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 06-read-data-minio-${i} --from-literal=data="${data}"
done
5 changes: 3 additions & 2 deletions e2e-tests/tests/gr-demand-backup/09-delete-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ commands:

source ../../functions

password=$(get_user_pass root)
run_mysql \
"TRUNCATE TABLE myDB.myTable" \
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -proot_password"
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -p'$password'"

cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 08-delete-data-s3-${i} --from-literal=data="${data}"
done
3 changes: 2 additions & 1 deletion e2e-tests/tests/gr-demand-backup/11-read-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ commands:

source ../../functions

password=$(get_user_pass root)
cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 06-read-data-s3-${i} --from-literal=data="${data}"
done
5 changes: 3 additions & 2 deletions e2e-tests/tests/gr-demand-backup/13-delete-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ commands:

source ../../functions

password=$(get_user_pass root)
run_mysql \
"TRUNCATE TABLE myDB.myTable" \
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -proot_password"
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -p'$password'"

cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 12-delete-data-gcp-${i} --from-literal=data="${data}"
done
3 changes: 2 additions & 1 deletion e2e-tests/tests/gr-demand-backup/15-read-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ commands:

source ../../functions

password=$(get_user_pass root)
cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 06-read-data-gcp-${i} --from-literal=data="${data}"
done
5 changes: 3 additions & 2 deletions e2e-tests/tests/gr-demand-backup/17-delete-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ commands:

source ../../functions

password=$(get_user_pass root)
run_mysql \
"TRUNCATE TABLE myDB.myTable" \
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -proot_password"
"-h $(get_mysql_router_service $(get_cluster_name)) -uroot -p'$password'"

cluster_name=$(get_cluster_name)
for i in 0 1 2; do
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -proot_password")
data=$(run_mysql "SELECT * FROM myDB.myTable" "-h ${cluster_name}-mysql-${i}.${cluster_name}-mysql -uroot -p'$password'")
kubectl create configmap -n "${NAMESPACE}" 16-delete-data-azure-${i} --from-literal=data="${data}"
done
Loading
Loading