Conversation
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shfmt
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 239 to 241 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 243 to 244 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 246 to 248 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 266 to 267 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 271 to 273 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 305 to 306 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 312 to 313 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 319 to 335 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 339 to 346 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 372 to 373 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 391 to 404 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 408 to 410 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 412 to 414 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 416 to 424 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 428 to 430 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 432 to 434 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 436 to 444 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 448 to 470 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 474 to 497 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 501 to 535 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 545 to 547 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 555 to 557 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 561 to 562 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 570 to 571 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 581 to 584 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 586 to 587 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 593 to 630 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 636 to 642 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 646 to 666 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 670 to 677 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 680 to 683 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 687 to 690 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 694 to 696 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 701 to 703 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 707 to 709 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 714 to 716 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 722 to 723 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 725 to 726 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 730 to 738 in 1b9dcdf
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 744 to 747 in 1b9dcdf
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" delete deployment percona-server-mysql-operator --force --grace-period=0 || true | ||
| if [[ $OPERATOR_NS ]]; then | ||
| kubectl delete namespace $OPERATOR_NS --force --grace-period=0 || true | ||
| fi |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" delete deployment percona-server-mysql-operator --force --grace-period=0 || true | |
| if [[ $OPERATOR_NS ]]; then | |
| kubectl delete namespace $OPERATOR_NS --force --grace-period=0 || true | |
| fi | |
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" delete deployment percona-server-mysql-operator --force --grace-period=0 || true | |
| if [[ $OPERATOR_NS ]]; then | |
| kubectl delete namespace $OPERATOR_NS --force --grace-period=0 || true | |
| fi |
|
|
||
| deploy_non_tls_cluster_secrets() { | ||
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/secrets.yaml" | ||
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/secrets.yaml" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/secrets.yaml" | |
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/secrets.yaml" |
|
|
||
| deploy_tls_cluster_secrets() { | ||
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/ssl-secret.yaml" | ||
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/ssl-secret.yaml" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/ssl-secret.yaml" | |
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/ssl-secret.yaml" |
|
|
||
| deploy_client() { | ||
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/client.yaml" | ||
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/client.yaml" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/client.yaml" | |
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/client.yaml" |
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/minio-secret.yml" | ||
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/cloud-secret.yml" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/minio-secret.yml" | |
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/cloud-secret.yml" | |
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/minio-secret.yml" | |
| kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/cloud-secret.yml" |
| local name_suffix=$1 | ||
|
|
||
| yq eval "$(printf '.metadata.name="%s"' "${test_name}${name_suffix:+-$name_suffix}")" "${DEPLOY_DIR}/cr.yaml" | | ||
| yq eval "$(printf '.spec.initImage="%s"' "${IMAGE}")" - | | ||
| yq eval '.spec.secretsName="test-secrets"' - | | ||
| yq eval '.spec.sslSecretName="test-ssl"' - | | ||
| yq eval '.spec.upgradeOptions.apply="disabled"' - | | ||
| yq eval '.spec.mysql.clusterType="async"' - | | ||
| yq eval "$(printf '.spec.mysql.image="%s"' "${IMAGE_MYSQL}")" - | | ||
| yq eval "$(printf '.spec.backup.image="%s"' "${IMAGE_BACKUP}")" - | | ||
| yq eval "$(printf '.spec.orchestrator.image="%s"' "${IMAGE_ORCHESTRATOR}")" - | | ||
| yq eval "$(printf '.spec.proxy.router.image="%s"' "${IMAGE_ROUTER}")" - | | ||
| yq eval "$(printf '.spec.toolkit.image="%s"' "${IMAGE_TOOLKIT}")" - | | ||
| yq eval "$(printf '.spec.proxy.haproxy.image="%s"' "${IMAGE_HAPROXY}")" - | | ||
| yq eval "$(printf '.spec.pmm.image="%s"' "${IMAGE_PMM_CLIENT}")" - | | ||
| if [ -n "${MINIKUBE}" ]; then | ||
| yq eval '(.. | select(has("antiAffinityTopologyKey")).antiAffinityTopologyKey) |= "none"' - | | ||
| yq eval '.spec.proxy.haproxy.resources.requests.cpu="300m"' - | ||
| else | ||
| yq eval - | ||
| fi |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local name_suffix=$1 | |
| yq eval "$(printf '.metadata.name="%s"' "${test_name}${name_suffix:+-$name_suffix}")" "${DEPLOY_DIR}/cr.yaml" | | |
| yq eval "$(printf '.spec.initImage="%s"' "${IMAGE}")" - | | |
| yq eval '.spec.secretsName="test-secrets"' - | | |
| yq eval '.spec.sslSecretName="test-ssl"' - | | |
| yq eval '.spec.upgradeOptions.apply="disabled"' - | | |
| yq eval '.spec.mysql.clusterType="async"' - | | |
| yq eval "$(printf '.spec.mysql.image="%s"' "${IMAGE_MYSQL}")" - | | |
| yq eval "$(printf '.spec.backup.image="%s"' "${IMAGE_BACKUP}")" - | | |
| yq eval "$(printf '.spec.orchestrator.image="%s"' "${IMAGE_ORCHESTRATOR}")" - | | |
| yq eval "$(printf '.spec.proxy.router.image="%s"' "${IMAGE_ROUTER}")" - | | |
| yq eval "$(printf '.spec.toolkit.image="%s"' "${IMAGE_TOOLKIT}")" - | | |
| yq eval "$(printf '.spec.proxy.haproxy.image="%s"' "${IMAGE_HAPROXY}")" - | | |
| yq eval "$(printf '.spec.pmm.image="%s"' "${IMAGE_PMM_CLIENT}")" - | | |
| if [ -n "${MINIKUBE}" ]; then | |
| yq eval '(.. | select(has("antiAffinityTopologyKey")).antiAffinityTopologyKey) |= "none"' - | | |
| yq eval '.spec.proxy.haproxy.resources.requests.cpu="300m"' - | |
| else | |
| yq eval - | |
| fi | |
| local name_suffix=$1 | |
| yq eval "$(printf '.metadata.name="%s"' "${test_name}${name_suffix:+-$name_suffix}")" "${DEPLOY_DIR}/cr.yaml" \ | |
| | yq eval "$(printf '.spec.initImage="%s"' "${IMAGE}")" - \ | |
| | yq eval '.spec.secretsName="test-secrets"' - \ | |
| | yq eval '.spec.sslSecretName="test-ssl"' - \ | |
| | yq eval '.spec.upgradeOptions.apply="disabled"' - \ | |
| | yq eval '.spec.mysql.clusterType="async"' - \ | |
| | yq eval "$(printf '.spec.mysql.image="%s"' "${IMAGE_MYSQL}")" - \ | |
| | yq eval "$(printf '.spec.backup.image="%s"' "${IMAGE_BACKUP}")" - \ | |
| | yq eval "$(printf '.spec.orchestrator.image="%s"' "${IMAGE_ORCHESTRATOR}")" - \ | |
| | yq eval "$(printf '.spec.proxy.router.image="%s"' "${IMAGE_ROUTER}")" - \ | |
| | yq eval "$(printf '.spec.toolkit.image="%s"' "${IMAGE_TOOLKIT}")" - \ | |
| | yq eval "$(printf '.spec.proxy.haproxy.image="%s"' "${IMAGE_HAPROXY}")" - \ | |
| | yq eval "$(printf '.spec.pmm.image="%s"' "${IMAGE_PMM_CLIENT}")" - \ | |
| | if [ -n "${MINIKUBE}" ]; then | |
| yq eval '(.. | select(has("antiAffinityTopologyKey")).antiAffinityTopologyKey) |= "none"' - \ | |
| | yq eval '.spec.proxy.haproxy.resources.requests.cpu="300m"' - | |
| else | |
| yq eval - | |
| fi |
| kubectl -n "${NAMESPACE}" get pods \ | ||
| --selector=name=mysql-client \ | ||
| -o 'jsonpath={.items[].metadata.name}' |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl -n "${NAMESPACE}" get pods \ | |
| --selector=name=mysql-client \ | |
| -o 'jsonpath={.items[].metadata.name}' | |
| kubectl -n "${NAMESPACE}" get pods \ | |
| --selector=name=mysql-client \ | |
| -o 'jsonpath={.items[].metadata.name}' |
| local command="$1" | ||
| local uri="$2" | ||
| local pod="$3" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local command="$1" | |
| local uri="$2" | |
| local pod="$3" | |
| local command="$1" | |
| local uri="$2" | |
| local pod="$3" |
| client_pod=$(get_client_pod) | ||
| wait_pod $client_pod 1>&2 |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| client_pod=$(get_client_pod) | |
| wait_pod $client_pod 1>&2 | |
| client_pod=$(get_client_pod) | |
| wait_pod $client_pod 1>&2 |
| kubectl -n "${NAMESPACE}" exec "${pod:-mysql-client}" -- \ | ||
| bash -c "printf '%s\n' \"${command}\" | mysql -sN $uri" 2>&1 | | ||
| sed -e 's/mysql: //' | | ||
| (grep -v 'Using a password on the command line interface can be insecure.' || :) |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl -n "${NAMESPACE}" exec "${pod:-mysql-client}" -- \ | |
| bash -c "printf '%s\n' \"${command}\" | mysql -sN $uri" 2>&1 | | |
| sed -e 's/mysql: //' | | |
| (grep -v 'Using a password on the command line interface can be insecure.' || :) | |
| kubectl -n "${NAMESPACE}" exec "${pod:-mysql-client}" -- \ | |
| bash -c "printf '%s\n' \"${command}\" | mysql -sN $uri" 2>&1 \ | |
| | sed -e 's/mysql: //' \ | |
| | (grep -v 'Using a password on the command line interface can be insecure.' || :) |
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shfmt
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 391 to 404 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 408 to 410 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 412 to 414 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 416 to 424 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 428 to 430 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 432 to 434 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 436 to 444 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 448 to 470 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 474 to 497 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 501 to 535 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 545 to 547 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 555 to 557 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 561 to 562 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 570 to 571 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 581 to 584 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 586 to 587 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 593 to 630 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 636 to 642 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 646 to 666 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 670 to 677 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 680 to 683 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 687 to 690 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 694 to 696 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 701 to 703 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 707 to 709 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 714 to 716 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 722 to 723 in c12f42e
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 725 to 726 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 730 to 738 in c12f42e
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 744 to 747 in c12f42e
| local command="$1" | ||
| local uri="$2" | ||
| local pod="$3" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local command="$1" | |
| local uri="$2" | |
| local pod="$3" | |
| local command="$1" | |
| local uri="$2" | |
| local pod="$3" |
| client_pod=$(get_client_pod) | ||
| wait_pod $client_pod 1>&2 |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| client_pod=$(get_client_pod) | |
| wait_pod $client_pod 1>&2 | |
| client_pod=$(get_client_pod) | |
| wait_pod $client_pod 1>&2 |
| kubectl -n "${NAMESPACE}" exec "${pod:-mysql-client}" -- \ | ||
| bash -c "printf '%s\n' \"${command}\" | mysqlsh --sql --quiet-start=2 $uri" 2>&1 | | ||
| tail -n +2 |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl -n "${NAMESPACE}" exec "${pod:-mysql-client}" -- \ | |
| bash -c "printf '%s\n' \"${command}\" | mysqlsh --sql --quiet-start=2 $uri" 2>&1 | | |
| tail -n +2 | |
| kubectl -n "${NAMESPACE}" exec "${pod:-mysql-client}" -- \ | |
| bash -c "printf '%s\n' \"${command}\" | mysqlsh --sql --quiet-start=2 $uri" 2>&1 \ | |
| | tail -n +2 |
|
|
||
| run_curl() { | ||
| kubectl -n "${NAMESPACE}" exec mysql-client -- bash -c "curl -s -k $*" | ||
| kubectl -n "${NAMESPACE}" exec mysql-client -- bash -c "curl -s -k $*" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl -n "${NAMESPACE}" exec mysql-client -- bash -c "curl -s -k $*" | |
| kubectl -n "${NAMESPACE}" exec mysql-client -- bash -c "curl -s -k $*" |
|
|
||
| get_innodb_cluster_name() { | ||
| echo $(get_cluster_name) | tr -cd '[^a-zA-Z0-9_]+' | ||
| echo $(get_cluster_name) | tr -cd '[^a-zA-Z0-9_]+' |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| echo $(get_cluster_name) | tr -cd '[^a-zA-Z0-9_]+' | |
| echo $(get_cluster_name) | tr -cd '[^a-zA-Z0-9_]+' |
| } | ||
| EOF | ||
| ) | ||
| ) |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| ) | |
| ) |
| run_curl -XPOST -d "'$(echo ${payload} | sed 's/\n//g')'" "https://${user_pass}@${endpoint}/v0/qan/GetReport" | | ||
| jq '.rows[].fingerprint' |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| run_curl -XPOST -d "'$(echo ${payload} | sed 's/\n//g')'" "https://${user_pass}@${endpoint}/v0/qan/GetReport" | | |
| jq '.rows[].fingerprint' | |
| run_curl -XPOST -d "'$(echo ${payload} | sed 's/\n//g')'" "https://${user_pass}@${endpoint}/v0/qan/GetReport" \ | |
| | jq '.rows[].fingerprint' |
|
|
||
| get_mysql_pods() { | ||
| kubectl get pod -n "${NAMESPACE}" --no-headers --selector=app.kubernetes.io/component=mysql | awk '{print $1}' | ||
| kubectl get pod -n "${NAMESPACE}" --no-headers --selector=app.kubernetes.io/component=mysql | awk '{print $1}' |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl get pod -n "${NAMESPACE}" --no-headers --selector=app.kubernetes.io/component=mysql | awk '{print $1}' | |
| kubectl get pod -n "${NAMESPACE}" --no-headers --selector=app.kubernetes.io/component=mysql | awk '{print $1}' |
|
|
||
| get_router_pods() { | ||
| kubectl get pod -n "${NAMESPACE}" --no-headers --selector=app.kubernetes.io/component=router | awk '{print $1}' | ||
| kubectl get pod -n "${NAMESPACE}" --no-headers --selector=app.kubernetes.io/component=router | awk '{print $1}' |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl get pod -n "${NAMESPACE}" --no-headers --selector=app.kubernetes.io/component=router | awk '{print $1}' | |
| kubectl get pod -n "${NAMESPACE}" --no-headers --selector=app.kubernetes.io/component=router | awk '{print $1}' |
|
|
||
| get_mysql_users() { | ||
| local args=$1 | ||
| local args=$1 |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local args=$1 | |
| local args=$1 |
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shfmt
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 680 to 683 in ef8cdba
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 687 to 690 in ef8cdba
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 694 to 696 in ef8cdba
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 701 to 703 in ef8cdba
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 707 to 709 in ef8cdba
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 714 to 716 in ef8cdba
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 722 to 723 in ef8cdba
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 725 to 726 in ef8cdba
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 730 to 738 in ef8cdba
[shfmt] reported by reviewdog 🐶
[shfmt] reported by reviewdog 🐶
percona-server-mysql-operator/e2e-tests/functions
Lines 744 to 747 in ef8cdba
| local args=$1 | ||
|
|
||
| run_mysql "SELECT user FROM mysql.user" "${args}" | grep -vE "mysql|root" | ||
| run_mysql "SELECT user FROM mysql.user" "${args}" | grep -vE "mysql|root" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| run_mysql "SELECT user FROM mysql.user" "${args}" | grep -vE "mysql|root" | |
| run_mysql "SELECT user FROM mysql.user" "${args}" | grep -vE "mysql|root" |
| local service=$1 | ||
|
|
||
| while (kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.spec.type}' 2>&1 || :) | grep -q NotFound; do | ||
| sleep 1 | ||
| done | ||
| if [ "$(kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.spec.type}')" = "ClusterIP" ]; then | ||
| kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.spec.clusterIP}' | ||
| return | ||
| fi | ||
| until kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.status.loadBalancer.ingress[]}' 2>&1 | egrep -q "hostname|ip"; do | ||
| sleep 1 | ||
| done | ||
| kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.status.loadBalancer.ingress[].ip}' | ||
| kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.status.loadBalancer.ingress[].hostname}' |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local service=$1 | |
| while (kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.spec.type}' 2>&1 || :) | grep -q NotFound; do | |
| sleep 1 | |
| done | |
| if [ "$(kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.spec.type}')" = "ClusterIP" ]; then | |
| kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.spec.clusterIP}' | |
| return | |
| fi | |
| until kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.status.loadBalancer.ingress[]}' 2>&1 | egrep -q "hostname|ip"; do | |
| sleep 1 | |
| done | |
| kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.status.loadBalancer.ingress[].ip}' | |
| kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.status.loadBalancer.ingress[].hostname}' | |
| local service=$1 | |
| while (kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.spec.type}' 2>&1 || :) | grep -q NotFound; do | |
| sleep 1 | |
| done | |
| if [ "$(kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.spec.type}')" = "ClusterIP" ]; then | |
| kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.spec.clusterIP}' | |
| return | |
| fi | |
| until kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.status.loadBalancer.ingress[]}' 2>&1 | egrep -q "hostname|ip"; do | |
| sleep 1 | |
| done | |
| kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.status.loadBalancer.ingress[].ip}' | |
| kubectl get service/$service -n "${NAMESPACE}" -o 'jsonpath={.status.loadBalancer.ingress[].hostname}' |
| local cluster_name=${1} | ||
| local cluster_size=${2} | ||
| local orc_size=${3} |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local cluster_name=${1} | |
| local cluster_size=${2} | |
| local orc_size=${3} | |
| local cluster_name=${1} | |
| local cluster_size=${2} | |
| local orc_size=${3} |
| if [ -z "${orc_size}" ]; then | ||
| orc_size=3 | ||
| fi |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| if [ -z "${orc_size}" ]; then | |
| orc_size=3 | |
| fi | |
| if [ -z "${orc_size}" ]; then | |
| orc_size=3 | |
| fi |
| sleep 7 # wait for two reconcile loops ;) 3 sec x 2 times + 1 sec = 7 seconds | ||
| until [[ "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.mysql.state}')" == "ready" && | ||
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.mysql.ready}')" == "${cluster_size}" && | ||
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.orchestrator.ready}')" == "${orc_size}" && | ||
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.orchestrator.state}')" == "ready" && | ||
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.state}')" == "ready" ]]; do | ||
| echo 'waiting for cluster readyness (async)' | ||
| sleep 15 | ||
| done |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| sleep 7 # wait for two reconcile loops ;) 3 sec x 2 times + 1 sec = 7 seconds | |
| until [[ "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.mysql.state}')" == "ready" && | |
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.mysql.ready}')" == "${cluster_size}" && | |
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.orchestrator.ready}')" == "${orc_size}" && | |
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.orchestrator.state}')" == "ready" && | |
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.state}')" == "ready" ]]; do | |
| echo 'waiting for cluster readyness (async)' | |
| sleep 15 | |
| done | |
| sleep 7 # wait for two reconcile loops ;) 3 sec x 2 times + 1 sec = 7 seconds | |
| until [[ "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.mysql.state}')" == "ready" && | |
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.mysql.ready}')" == "${cluster_size}" && | |
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.orchestrator.ready}')" == "${orc_size}" && | |
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.orchestrator.state}')" == "ready" && | |
| "$(kubectl get ps "${cluster_name}" -n "${NAMESPACE}" -o jsonpath='{.status.state}')" == "ready" ]]; do | |
| echo 'waiting for cluster readyness (async)' | |
| sleep 15 | |
| done |
| local secrets | ||
| local passwords | ||
| local pods | ||
|
|
||
| secrets=$(kubectl get secrets -o json | jq -r '.items[].data | to_entries | .[] | select(.key | (endswith(".crt") or endswith(".key") or endswith(".pub") or endswith(".pem") or endswith(".p12") or test("namespace")) | not) | .value') | ||
| passwords="$(for i in $secrets; do | ||
| base64 -d <<<$i | ||
| echo | ||
| done) $secrets" | ||
| pods=$(kubectl -n "${NAMESPACE}" get pods -o name | awk -F "/" '{print $2}') | ||
|
|
||
| collect_logs() { | ||
| local containers | ||
| local count | ||
|
|
||
| NS=$1 | ||
| for p in $pods; do | ||
| local containers=$(kubectl -n "$NS" get pod $p -o jsonpath='{.spec.containers[*].name}') | ||
| for c in $containers; do | ||
| kubectl -n "$NS" logs $p -c $c >${TEMP_DIR}/logs_output-$p-$c.txt | ||
| echo logs saved in: ${TEMP_DIR}/logs_output-$p-$c.txt | ||
| for pass in $passwords; do | ||
| local count=$(grep -c --fixed-strings -- "$pass" ${TEMP_DIR}/logs_output-$p-$c.txt || :) | ||
| if [[ $count != 0 ]]; then | ||
| echo leaked passwords are found in log ${TEMP_DIR}/logs_output-$p-$c.txt | ||
| false | ||
| fi | ||
| done | ||
| done | ||
| echo | ||
| done | ||
| } | ||
|
|
||
| collect_logs $NAMESPACE | ||
| if [ -n "$OPERATOR_NS" ]; then | ||
| local pods=$(kubectl -n "${OPERATOR_NS}" get pods -o name | awk -F "/" '{print $2}') | ||
| collect_logs $OPERATOR_NS | ||
| fi |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local secrets | |
| local passwords | |
| local pods | |
| secrets=$(kubectl get secrets -o json | jq -r '.items[].data | to_entries | .[] | select(.key | (endswith(".crt") or endswith(".key") or endswith(".pub") or endswith(".pem") or endswith(".p12") or test("namespace")) | not) | .value') | |
| passwords="$(for i in $secrets; do | |
| base64 -d <<<$i | |
| echo | |
| done) $secrets" | |
| pods=$(kubectl -n "${NAMESPACE}" get pods -o name | awk -F "/" '{print $2}') | |
| collect_logs() { | |
| local containers | |
| local count | |
| NS=$1 | |
| for p in $pods; do | |
| local containers=$(kubectl -n "$NS" get pod $p -o jsonpath='{.spec.containers[*].name}') | |
| for c in $containers; do | |
| kubectl -n "$NS" logs $p -c $c >${TEMP_DIR}/logs_output-$p-$c.txt | |
| echo logs saved in: ${TEMP_DIR}/logs_output-$p-$c.txt | |
| for pass in $passwords; do | |
| local count=$(grep -c --fixed-strings -- "$pass" ${TEMP_DIR}/logs_output-$p-$c.txt || :) | |
| if [[ $count != 0 ]]; then | |
| echo leaked passwords are found in log ${TEMP_DIR}/logs_output-$p-$c.txt | |
| false | |
| fi | |
| done | |
| done | |
| echo | |
| done | |
| } | |
| collect_logs $NAMESPACE | |
| if [ -n "$OPERATOR_NS" ]; then | |
| local pods=$(kubectl -n "${OPERATOR_NS}" get pods -o name | awk -F "/" '{print $2}') | |
| collect_logs $OPERATOR_NS | |
| fi | |
| local secrets | |
| local passwords | |
| local pods | |
| secrets=$(kubectl get secrets -o json | jq -r '.items[].data | to_entries | .[] | select(.key | (endswith(".crt") or endswith(".key") or endswith(".pub") or endswith(".pem") or endswith(".p12") or test("namespace")) | not) | .value') | |
| passwords="$(for i in $secrets; do | |
| base64 -d <<<$i | |
| echo | |
| done) $secrets" | |
| pods=$(kubectl -n "${NAMESPACE}" get pods -o name | awk -F "/" '{print $2}') | |
| collect_logs() { | |
| local containers | |
| local count | |
| NS=$1 | |
| for p in $pods; do | |
| local containers=$(kubectl -n "$NS" get pod $p -o jsonpath='{.spec.containers[*].name}') | |
| for c in $containers; do | |
| kubectl -n "$NS" logs $p -c $c >${TEMP_DIR}/logs_output-$p-$c.txt | |
| echo logs saved in: ${TEMP_DIR}/logs_output-$p-$c.txt | |
| for pass in $passwords; do | |
| local count=$(grep -c --fixed-strings -- "$pass" ${TEMP_DIR}/logs_output-$p-$c.txt || :) | |
| if [[ $count != 0 ]]; then | |
| echo leaked passwords are found in log ${TEMP_DIR}/logs_output-$p-$c.txt | |
| false | |
| fi | |
| done | |
| done | |
| echo | |
| done | |
| } | |
| collect_logs $NAMESPACE | |
| if [ -n "$OPERATOR_NS" ]; then | |
| local pods=$(kubectl -n "${OPERATOR_NS}" get pods -o name | awk -F "/" '{print $2}') | |
| collect_logs $OPERATOR_NS | |
| fi |
|
|
||
| deploy_chaos_mesh() { | ||
| destroy_chaos_mesh | ||
| destroy_chaos_mesh |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| destroy_chaos_mesh | |
| destroy_chaos_mesh |
| helm repo add chaos-mesh https://charts.chaos-mesh.org | ||
| if [ -n "${MINIKUBE}" ]; then | ||
| helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${NAMESPACE} --set chaosDaemon.runtime=docker --set dashboard.create=false --version 2.5.1 | ||
| else | ||
| helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${NAMESPACE} --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock --set dashboard.create=false --version 2.5.1 | ||
| fi | ||
| sleep 10 |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| helm repo add chaos-mesh https://charts.chaos-mesh.org | |
| if [ -n "${MINIKUBE}" ]; then | |
| helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${NAMESPACE} --set chaosDaemon.runtime=docker --set dashboard.create=false --version 2.5.1 | |
| else | |
| helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${NAMESPACE} --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock --set dashboard.create=false --version 2.5.1 | |
| fi | |
| sleep 10 | |
| helm repo add chaos-mesh https://charts.chaos-mesh.org | |
| if [ -n "${MINIKUBE}" ]; then | |
| helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${NAMESPACE} --set chaosDaemon.runtime=docker --set dashboard.create=false --version 2.5.1 | |
| else | |
| helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${NAMESPACE} --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock --set dashboard.create=false --version 2.5.1 | |
| fi | |
| sleep 10 |
| local chaos_mesh_ns=$(helm list --all-namespaces --filter chaos-mesh | tail -n1 | awk -F' ' '{print $2}' | sed 's/NAMESPACE//') | ||
|
|
||
| if [ -n "${chaos_mesh_ns}" ]; then | ||
| helm uninstall --wait --timeout 60s chaos-mesh --namespace ${chaos_mesh_ns} || : | ||
| fi | ||
| timeout 30 kubectl delete MutatingWebhookConfiguration $(kubectl get MutatingWebhookConfiguration | grep 'chaos-mesh' | awk '{print $1}') || : | ||
| timeout 30 kubectl delete ValidatingWebhookConfiguration $(kubectl get ValidatingWebhookConfiguration | grep 'chaos-mesh' | awk '{print $1}') || : | ||
| timeout 30 kubectl delete ValidatingWebhookConfiguration $(kubectl get ValidatingWebhookConfiguration | grep 'validate-auth' | awk '{print $1}') || : | ||
| for i in $(kubectl api-resources | grep chaos-mesh | awk '{print $1}'); do | ||
| kubectl get ${i} --all-namespaces --no-headers -o custom-columns=Kind:.kind,Name:.metadata.name,NAMESPACE:.metadata.namespace | | ||
| while read -r line; do | ||
| local kind=$(echo "$line" | awk '{print $1}') | ||
| local name=$(echo "$line" | awk '{print $2}') | ||
| local namespace=$(echo "$line" | awk '{print $3}') | ||
| kubectl patch $kind $name -n "${namespace}" --type=merge -p '{"metadata":{"finalizers":[]}}' || : | ||
| done | ||
| timeout 30 kubectl delete ${i} --all --all-namespaces || : | ||
| done | ||
| timeout 30 kubectl delete crd $(kubectl get crd | grep 'chaos-mesh.org' | awk '{print $1}') || : | ||
| timeout 30 kubectl delete clusterrolebinding $(kubectl get clusterrolebinding | grep 'chaos-mesh' | awk '{print $1}') || : | ||
| timeout 30 kubectl delete clusterrole $(kubectl get clusterrole | grep 'chaos-mesh' | awk '{print $1}') || : |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local chaos_mesh_ns=$(helm list --all-namespaces --filter chaos-mesh | tail -n1 | awk -F' ' '{print $2}' | sed 's/NAMESPACE//') | |
| if [ -n "${chaos_mesh_ns}" ]; then | |
| helm uninstall --wait --timeout 60s chaos-mesh --namespace ${chaos_mesh_ns} || : | |
| fi | |
| timeout 30 kubectl delete MutatingWebhookConfiguration $(kubectl get MutatingWebhookConfiguration | grep 'chaos-mesh' | awk '{print $1}') || : | |
| timeout 30 kubectl delete ValidatingWebhookConfiguration $(kubectl get ValidatingWebhookConfiguration | grep 'chaos-mesh' | awk '{print $1}') || : | |
| timeout 30 kubectl delete ValidatingWebhookConfiguration $(kubectl get ValidatingWebhookConfiguration | grep 'validate-auth' | awk '{print $1}') || : | |
| for i in $(kubectl api-resources | grep chaos-mesh | awk '{print $1}'); do | |
| kubectl get ${i} --all-namespaces --no-headers -o custom-columns=Kind:.kind,Name:.metadata.name,NAMESPACE:.metadata.namespace | | |
| while read -r line; do | |
| local kind=$(echo "$line" | awk '{print $1}') | |
| local name=$(echo "$line" | awk '{print $2}') | |
| local namespace=$(echo "$line" | awk '{print $3}') | |
| kubectl patch $kind $name -n "${namespace}" --type=merge -p '{"metadata":{"finalizers":[]}}' || : | |
| done | |
| timeout 30 kubectl delete ${i} --all --all-namespaces || : | |
| done | |
| timeout 30 kubectl delete crd $(kubectl get crd | grep 'chaos-mesh.org' | awk '{print $1}') || : | |
| timeout 30 kubectl delete clusterrolebinding $(kubectl get clusterrolebinding | grep 'chaos-mesh' | awk '{print $1}') || : | |
| timeout 30 kubectl delete clusterrole $(kubectl get clusterrole | grep 'chaos-mesh' | awk '{print $1}') || : | |
| local chaos_mesh_ns=$(helm list --all-namespaces --filter chaos-mesh | tail -n1 | awk -F' ' '{print $2}' | sed 's/NAMESPACE//') | |
| if [ -n "${chaos_mesh_ns}" ]; then | |
| helm uninstall --wait --timeout 60s chaos-mesh --namespace ${chaos_mesh_ns} || : | |
| fi | |
| timeout 30 kubectl delete MutatingWebhookConfiguration $(kubectl get MutatingWebhookConfiguration | grep 'chaos-mesh' | awk '{print $1}') || : | |
| timeout 30 kubectl delete ValidatingWebhookConfiguration $(kubectl get ValidatingWebhookConfiguration | grep 'chaos-mesh' | awk '{print $1}') || : | |
| timeout 30 kubectl delete ValidatingWebhookConfiguration $(kubectl get ValidatingWebhookConfiguration | grep 'validate-auth' | awk '{print $1}') || : | |
| for i in $(kubectl api-resources | grep chaos-mesh | awk '{print $1}'); do | |
| kubectl get ${i} --all-namespaces --no-headers -o custom-columns=Kind:.kind,Name:.metadata.name,NAMESPACE:.metadata.namespace \ | |
| | while read -r line; do | |
| local kind=$(echo "$line" | awk '{print $1}') | |
| local name=$(echo "$line" | awk '{print $2}') | |
| local namespace=$(echo "$line" | awk '{print $3}') | |
| kubectl patch $kind $name -n "${namespace}" --type=merge -p '{"metadata":{"finalizers":[]}}' || : | |
| done | |
| timeout 30 kubectl delete ${i} --all --all-namespaces || : | |
| done | |
| timeout 30 kubectl delete crd $(kubectl get crd | grep 'chaos-mesh.org' | awk '{print $1}') || : | |
| timeout 30 kubectl delete clusterrolebinding $(kubectl get clusterrolebinding | grep 'chaos-mesh' | awk '{print $1}') || : | |
| timeout 30 kubectl delete clusterrole $(kubectl get clusterrole | grep 'chaos-mesh' | awk '{print $1}') || : |
| local ns=$1 | ||
| local selector=$2 | ||
| local pod_label=$3 | ||
| local label_value=$4 | ||
| local chaos_suffix=$5 | ||
|
|
||
| if [ "${selector}" == "pod" ]; then | ||
| yq eval ' |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local ns=$1 | |
| local selector=$2 | |
| local pod_label=$3 | |
| local label_value=$4 | |
| local chaos_suffix=$5 | |
| if [ "${selector}" == "pod" ]; then | |
| yq eval ' | |
| local ns=$1 | |
| local selector=$2 | |
| local pod_label=$3 | |
| local label_value=$4 | |
| local chaos_suffix=$5 | |
| if [ "${selector}" == "pod" ]; then | |
| yq eval ' |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| .spec.selector.pods.'${ns}'[0] = "'${pod_label}'"' ${TESTS_CONFIG_DIR}/chaos-pod-kill.yml | | ||
| kubectl apply --namespace ${ns} -f - | ||
| elif [ "${selector}" == "label" ]; then | ||
| yq eval ' |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| .spec.selector.pods.'${ns}'[0] = "'${pod_label}'"' ${TESTS_CONFIG_DIR}/chaos-pod-kill.yml | | |
| kubectl apply --namespace ${ns} -f - | |
| elif [ "${selector}" == "label" ]; then | |
| yq eval ' | |
| .spec.selector.pods.'${ns}'[0] = "'${pod_label}'"' ${TESTS_CONFIG_DIR}/chaos-pod-kill.yml \ | |
| | kubectl apply --namespace ${ns} -f - | |
| elif [ "${selector}" == "label" ]; then | |
| yq eval ' |
| .spec.selector.labelSelectors."'${pod_label}'" = "'${label_value}'"' ${TESTS_CONFIG_DIR}/chaos-pod-kill.yml | | ||
| kubectl apply --namespace ${ns} -f - | ||
| fi | ||
| sleep 5 |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| .spec.selector.labelSelectors."'${pod_label}'" = "'${label_value}'"' ${TESTS_CONFIG_DIR}/chaos-pod-kill.yml | | |
| kubectl apply --namespace ${ns} -f - | |
| fi | |
| sleep 5 | |
| .spec.selector.labelSelectors."'${pod_label}'" = "'${label_value}'"' ${TESTS_CONFIG_DIR}/chaos-pod-kill.yml \ | |
| | kubectl apply --namespace ${ns} -f - | |
| fi | |
| sleep 5 |
| local ns=$1 | ||
| local pod=$2 | ||
| local chaos_suffix=$3 |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local ns=$1 | |
| local pod=$2 | |
| local chaos_suffix=$3 | |
| local ns=$1 | |
| local pod=$2 | |
| local chaos_suffix=$3 |
| local chaos_suffix=$3 | ||
|
|
||
| yq eval ' | ||
| yq eval ' |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| yq eval ' | |
| yq eval ' |
| .spec.selector.pods.'${ns}'[0] = "'${pod}'"' ${TESTS_CONFIG_DIR}/chaos-pod-failure.yml | | ||
| kubectl apply --namespace ${ns} -f - | ||
| sleep 5 |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| .spec.selector.pods.'${ns}'[0] = "'${pod}'"' ${TESTS_CONFIG_DIR}/chaos-pod-failure.yml | | |
| kubectl apply --namespace ${ns} -f - | |
| sleep 5 | |
| .spec.selector.pods.'${ns}'[0] = "'${pod}'"' ${TESTS_CONFIG_DIR}/chaos-pod-failure.yml \ | |
| | kubectl apply --namespace ${ns} -f - | |
| sleep 5 |
| local revision | ||
| revision=$(kubectl get -n "${NAMESPACE}" certificate "$certificate" -o 'jsonpath={.status.revision}') |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local revision | |
| revision=$(kubectl get -n "${NAMESPACE}" certificate "$certificate" -o 'jsonpath={.status.revision}') | |
| local revision | |
| revision=$(kubectl get -n "${NAMESPACE}" certificate "$certificate" -o 'jsonpath={.status.revision}') |
| revision=$(kubectl get -n "${NAMESPACE}" certificate "$certificate" -o 'jsonpath={.status.revision}') | ||
|
|
||
| kubectl exec -n "${NAMESPACE}" "$pod_name" -- /tmp/cmctl renew "$certificate" | ||
| kubectl exec -n "${NAMESPACE}" "$pod_name" -- /tmp/cmctl renew "$certificate" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| kubectl exec -n "${NAMESPACE}" "$pod_name" -- /tmp/cmctl renew "$certificate" | |
| kubectl exec -n "${NAMESPACE}" "$pod_name" -- /tmp/cmctl renew "$certificate" |
| # wait for new revision | ||
| for i in {1..10}; do | ||
| local new_revision | ||
| new_revision=$(kubectl get -n "${NAMESPACE}" certificate "$certificate" -o 'jsonpath={.status.revision}') | ||
| if [ "$((revision + 1))" == "$new_revision" ]; then | ||
| break | ||
| fi | ||
| sleep 1 | ||
| done |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| # wait for new revision | |
| for i in {1..10}; do | |
| local new_revision | |
| new_revision=$(kubectl get -n "${NAMESPACE}" certificate "$certificate" -o 'jsonpath={.status.revision}') | |
| if [ "$((revision + 1))" == "$new_revision" ]; then | |
| break | |
| fi | |
| sleep 1 | |
| done | |
| # wait for new revision | |
| for i in {1..10}; do | |
| local new_revision | |
| new_revision=$(kubectl get -n "${NAMESPACE}" certificate "$certificate" -o 'jsonpath={.status.revision}') | |
| if [ "$((revision + 1))" == "$new_revision" ]; then | |
| break | |
| fi | |
| sleep 1 | |
| done |
|
|
||
| deploy_cmctl() { | ||
| local service_account="cmctl" | ||
| local service_account="cmctl" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local service_account="cmctl" | |
| local service_account="cmctl" |
| sed -e "s/percona-server-mysql-operator/$service_account/g" "${DEPLOY_DIR}/rbac.yaml" | | ||
| yq '(select(.rules).rules[] | select(contains({"apiGroups": ["cert-manager.io"]}))).resources += "certificates/status"' | | ||
| kubectl apply -n "${NAMESPACE}" -f - | ||
| kubectl apply -n "${NAMESPACE}" -f "${TESTS_CONFIG_DIR}/cmctl.yml" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| sed -e "s/percona-server-mysql-operator/$service_account/g" "${DEPLOY_DIR}/rbac.yaml" | | |
| yq '(select(.rules).rules[] | select(contains({"apiGroups": ["cert-manager.io"]}))).resources += "certificates/status"' | | |
| kubectl apply -n "${NAMESPACE}" -f - | |
| kubectl apply -n "${NAMESPACE}" -f "${TESTS_CONFIG_DIR}/cmctl.yml" | |
| sed -e "s/percona-server-mysql-operator/$service_account/g" "${DEPLOY_DIR}/rbac.yaml" \ | |
| | yq '(select(.rules).rules[] | select(contains({"apiGroups": ["cert-manager.io"]}))).resources += "certificates/status"' \ | |
| | kubectl apply -n "${NAMESPACE}" -f - | |
| kubectl apply -n "${NAMESPACE}" -f "${TESTS_CONFIG_DIR}/cmctl.yml" |
e2e-tests/functions
Outdated
|
|
||
| deploy_operator() { | ||
| destroy_operator | ||
| destroy_operator |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| destroy_operator | |
| destroy_operator |
| if [[ $OPERATOR_NS ]]; then | ||
| create_namespace "${OPERATOR_NS}" | ||
| fi | ||
|
|
||
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply --server-side --force-conflicts -f "${DEPLOY_DIR}/crd.yaml" | ||
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply --server-side --force-conflicts -f "${DEPLOY_DIR}/crd.yaml" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| if [[ $OPERATOR_NS ]]; then | |
| create_namespace "${OPERATOR_NS}" | |
| fi | |
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply --server-side --force-conflicts -f "${DEPLOY_DIR}/crd.yaml" | |
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply --server-side --force-conflicts -f "${DEPLOY_DIR}/crd.yaml" | |
| if [[ $OPERATOR_NS ]]; then | |
| create_namespace "${OPERATOR_NS}" | |
| fi |
| if [ -n "$OPERATOR_NS" ]; then | ||
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f "${DEPLOY_DIR}/cw-rbac.yaml" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| if [ -n "$OPERATOR_NS" ]; then | |
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f "${DEPLOY_DIR}/cw-rbac.yaml" | |
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply --server-side --force-conflicts -f "${DEPLOY_DIR}/crd.yaml" |
| yq eval \ | ||
| "$(printf 'select(documentIndex==1).spec.template.spec.containers[0].image="%s"' "${IMAGE}")" \ | ||
| "${DEPLOY_DIR}/cw-operator.yaml" | | ||
| yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="DISABLE_TELEMETRY").value) = "true"' | | ||
| yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="LOG_LEVEL").value) = "DEBUG"' | | ||
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f - | ||
| else | ||
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f "${DEPLOY_DIR}/rbac.yaml" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| yq eval \ | |
| "$(printf 'select(documentIndex==1).spec.template.spec.containers[0].image="%s"' "${IMAGE}")" \ | |
| "${DEPLOY_DIR}/cw-operator.yaml" | | |
| yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="DISABLE_TELEMETRY").value) = "true"' | | |
| yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="LOG_LEVEL").value) = "DEBUG"' | | |
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f - | |
| else | |
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f "${DEPLOY_DIR}/rbac.yaml" | |
| if [ -n "$OPERATOR_NS" ]; then | |
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f "${DEPLOY_DIR}/cw-rbac.yaml" |
| yq eval \ | ||
| "$(printf 'select(documentIndex==1).spec.template.spec.containers[0].image="%s"' "${IMAGE}")" \ | ||
| "${DEPLOY_DIR}/operator.yaml" | | ||
| yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="DISABLE_TELEMETRY").value) = "true"' | | ||
| yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="LOG_LEVEL").value) = "DEBUG"' | | ||
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f - | ||
| fi |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| yq eval \ | |
| "$(printf 'select(documentIndex==1).spec.template.spec.containers[0].image="%s"' "${IMAGE}")" \ | |
| "${DEPLOY_DIR}/operator.yaml" | | |
| yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="DISABLE_TELEMETRY").value) = "true"' | | |
| yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="LOG_LEVEL").value) = "DEBUG"' | | |
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f - | |
| fi | |
| yq eval \ | |
| "$(printf 'select(documentIndex==1).spec.template.spec.containers[0].image="%s"' "${IMAGE}")" \ | |
| "${DEPLOY_DIR}/cw-operator.yaml" \ | |
| | yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="DISABLE_TELEMETRY").value) = "true"' \ | |
| | yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="LOG_LEVEL").value) = "DEBUG"' \ | |
| | kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f - | |
| else | |
| kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f "${DEPLOY_DIR}/rbac.yaml" | |
| yq eval \ | |
| "$(printf 'select(documentIndex==1).spec.template.spec.containers[0].image="%s"' "${IMAGE}")" \ | |
| "${DEPLOY_DIR}/operator.yaml" \ | |
| | yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="DISABLE_TELEMETRY").value) = "true"' \ | |
| | yq eval '(select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="LOG_LEVEL").value) = "DEBUG"' \ | |
| | kubectl -n "${OPERATOR_NS:-$NAMESPACE}" apply -f - | |
| fi |
| local max=$1 | ||
| local delay=$2 | ||
| shift 2 # cut delay and max args | ||
| local n=1 | ||
|
|
||
| until "$@"; do | ||
| if [[ $n -ge $max ]]; then | ||
| echo "The command ${*} has failed after $n attempts." | ||
| exit 1 | ||
| fi | ||
| ((n++)) | ||
| sleep $delay | ||
| done |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local max=$1 | |
| local delay=$2 | |
| shift 2 # cut delay and max args | |
| local n=1 | |
| until "$@"; do | |
| if [[ $n -ge $max ]]; then | |
| echo "The command ${*} has failed after $n attempts." | |
| exit 1 | |
| fi | |
| ((n++)) | |
| sleep $delay | |
| done | |
| local max=$1 | |
| local delay=$2 | |
| shift 2 # cut delay and max args | |
| local n=1 | |
| until "$@"; do | |
| if [[ $n -ge $max ]]; then | |
| echo "The command ${*} has failed after $n attempts." | |
| exit 1 | |
| fi | |
| ((n++)) | |
| sleep $delay | |
| done |
|
|
||
| deploy_cmctl() { | ||
| local service_account="cmctl" | ||
| local service_account="cmctl" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| local service_account="cmctl" | |
| local service_account="cmctl" |
| sed -e "s/percona-server-mysql-operator/$service_account/g" "${DEPLOY_DIR}/rbac.yaml" | | ||
| yq '(select(.rules).rules[] | select(contains({"apiGroups": ["cert-manager.io"]}))).resources += "certificates/status"' | | ||
| kubectl apply -n "${NAMESPACE}" -f - | ||
| kubectl apply -n "${NAMESPACE}" -f "${TESTS_CONFIG_DIR}/cmctl.yml" |
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
| sed -e "s/percona-server-mysql-operator/$service_account/g" "${DEPLOY_DIR}/rbac.yaml" | | |
| yq '(select(.rules).rules[] | select(contains({"apiGroups": ["cert-manager.io"]}))).resources += "certificates/status"' | | |
| kubectl apply -n "${NAMESPACE}" -f - | |
| kubectl apply -n "${NAMESPACE}" -f "${TESTS_CONFIG_DIR}/cmctl.yml" | |
| sed -e "s/percona-server-mysql-operator/$service_account/g" "${DEPLOY_DIR}/rbac.yaml" \ | |
| | yq '(select(.rules).rules[] | select(contains({"apiGroups": ["cert-manager.io"]}))).resources += "certificates/status"' \ | |
| | kubectl apply -n "${NAMESPACE}" -f - | |
| kubectl apply -n "${NAMESPACE}" -f "${TESTS_CONFIG_DIR}/cmctl.yml" |
commit: 6555938 |
CHANGE DESCRIPTION
Problem:
async self healing test is currently failing on the main branch and will need to be merged after fixes for K8SPS-289 and K8SPS-288
which is altogether probable connected with #339
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability