Add support of the official MySQL Docker image - #1198
Draft
hors wants to merge 10 commits into
Draft
Conversation
hors
force-pushed
the
support-oracle-mysql
branch
from
February 11, 2026 12:38
de665c8 to
8b3d095
Compare
Contributor
There was a problem hiding this comment.
[gofmt] reported by reviewdog 🐶
percona-server-mysql-operator/pkg/mysql/mysql.go
Lines 23 to 41 in 086ef01
| --selector=name=mysql-client \ | ||
| -o 'jsonpath={.items[*].metadata.name}' 2>/dev/null) || true | ||
| pod="${pod%% *}" | ||
| if [[ -n "$pod" ]]; then |
Contributor
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
Suggested change
| if [[ -n "$pod" ]]; then | |
| if [[ -n $pod ]]; then |
| bash -c "printf '%s\n' \"${command}\" | mysql -sN $host $user" 2>&1 \ | ||
| local target_pod="${pod:-mysql-client}" | ||
| local container_opt=() | ||
| if [[ "${target_pod}" != "mysql-client" ]]; then |
Contributor
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
Suggested change
| if [[ "${target_pod}" != "mysql-client" ]]; then | |
| if [[ ${target_pod} != "mysql-client" ]]; then |
| # does not match mysqld (e.g. /var/run/mysqld/mysqld.sock vs /var/lib/mysql/mysql.sock). | ||
| # Operator + ps-entrypoint always use ${DataMountPath}/mysql.sock (see pkg/mysql DataMountPath). | ||
| local conn_args="${host}" | ||
| if [[ "${target_pod}" != "mysql-client" && "${host}" == *"localhost"* ]]; then |
Contributor
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
Suggested change
| if [[ "${target_pod}" != "mysql-client" && "${host}" == *"localhost"* ]]; then | |
| if [[ ${target_pod} != "mysql-client" && ${host} == *"localhost"* ]]; then |
| socket=$(kubectl -n "${NAMESPACE}" exec "${target_pod}" "${container_opt[@]}" -- \ | ||
| env MYSQL_PWD="${root_pw}" mysql -sN -uroot --socket="${operator_sock}" -e "SELECT @@socket" 2>/dev/null | tail -1) | ||
| socket=$(echo "${socket}" | tr -d '\r' | tr -d '[:space:]') | ||
| if [[ -z "${socket}" ]]; then |
Contributor
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
Suggested change
| if [[ -z "${socket}" ]]; then | |
| if [[ -z ${socket} ]]; then |
| local sql_mode="--sql" | ||
|
|
||
| # Port 33060 is MySQL X Protocol; --sql uses classic protocol and fails on 8.4+ (ERROR 2007). | ||
| if [[ "$host" =~ -P[[:space:]]*33060 ]] || [[ "$host" =~ :33060 ]]; then |
Contributor
There was a problem hiding this comment.
[shfmt] reported by reviewdog 🐶
Suggested change
| if [[ "$host" =~ -P[[:space:]]*33060 ]] || [[ "$host" =~ :33060 ]]; then | |
| if [[ $host =~ -P[[:space:]]*33060 ]] || [[ $host =~ :33060 ]]; then |
Collaborator
commit: f0c6e8f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to the high volume of requests, we're unable to provide free service for this account. To continue using the service, please upgarde to a paid plan.
CHANGEDESCRIPTION
Problem:
Short explanation of the problem.
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability