Skip to content

Commit

Permalink
healthcheck for 11.4+ - skip tls validation
Browse files Browse the repository at this point in the history
In case of missing ssl-ca like #594
  • Loading branch information
grooverdan committed Jun 11, 2024
1 parent 0aa7324 commit 11135d0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions 11.4-ubi/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ _process_sql()
${def['file']:+--defaults-file=${def['file']}} \
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
--skip-ssl --skip-ssl-verify-server-cert \
-B "$@"
}

Expand All @@ -62,6 +63,7 @@ connect()
${def['file']:+--defaults-file=${def['file']}} \
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
--skip-ssl --skip-ssl-verify-server-cert \
-h localhost --protocol tcp -e 'select 1' 2>&1 \
| grep -qF "Can't connect"
local ret=${PIPESTATUS[1]}
Expand Down
2 changes: 2 additions & 0 deletions 11.4/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ _process_sql()
${def['file']:+--defaults-file=${def['file']}} \
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
--skip-ssl --skip-ssl-verify-server-cert \
-B "$@"
}

Expand All @@ -62,6 +63,7 @@ connect()
${def['file']:+--defaults-file=${def['file']}} \
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
--skip-ssl --skip-ssl-verify-server-cert \
-h localhost --protocol tcp -e 'select 1' 2>&1 \
| grep -qF "Can't connect"
local ret=${PIPESTATUS[1]}
Expand Down
2 changes: 2 additions & 0 deletions 11.5-ubi/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ _process_sql()
${def['file']:+--defaults-file=${def['file']}} \
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
--skip-ssl --skip-ssl-verify-server-cert \
-B "$@"
}

Expand All @@ -62,6 +63,7 @@ connect()
${def['file']:+--defaults-file=${def['file']}} \
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
--skip-ssl --skip-ssl-verify-server-cert \
-h localhost --protocol tcp -e 'select 1' 2>&1 \
| grep -qF "Can't connect"
local ret=${PIPESTATUS[1]}
Expand Down
2 changes: 2 additions & 0 deletions 11.5/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ _process_sql()
${def['file']:+--defaults-file=${def['file']}} \
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
--skip-ssl --skip-ssl-verify-server-cert \
-B "$@"
}

Expand All @@ -62,6 +63,7 @@ connect()
${def['file']:+--defaults-file=${def['file']}} \
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
--skip-ssl --skip-ssl-verify-server-cert \
-h localhost --protocol tcp -e 'select 1' 2>&1 \
| grep -qF "Can't connect"
local ret=${PIPESTATUS[1]}
Expand Down
2 changes: 2 additions & 0 deletions healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ _process_sql()
${def['file']:+--defaults-file=${def['file']}} \
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
--skip-ssl --skip-ssl-verify-server-cert \
-B "$@"
}

Expand All @@ -62,6 +63,7 @@ connect()
${def['file']:+--defaults-file=${def['file']}} \
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
--skip-ssl --skip-ssl-verify-server-cert \
-h localhost --protocol tcp -e 'select 1' 2>&1 \
| grep -qF "Can't connect"
local ret=${PIPESTATUS[1]}
Expand Down
10 changes: 7 additions & 3 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,22 @@ update_version()
10.4)
sed -i -e '/--old-mode/d' \
-e 's/REPLICATION REPLICA/REPLICATION SLAVE/' \
-e 's/START REPLICA/START SLAVE/' \
-e 's/START REPLICA/START SLAVE/' \
-e '/memory\.pressure/,+7d' \
-e '/--skip-ssl/d' \
"$version/docker-entrypoint.sh"
sed -i -e 's/ REPLICA\$/ SLAVE$/' "$dir"/healthcheck.sh
sed -i -e 's/ REPLICA\$/ SLAVE$/' \
-e '/--skip-ssl/d' \
"$dir"/healthcheck.sh
sed -i -e 's/\/run/\/var\/run\//g' "$dir/Dockerfile"
;; # almost nothing to see/do here
10.5)
sed -i -e '/--old-mode/d' \
-e '/--skip-ssl/d' \
-e '/memory\.pressure/,+7d' "$dir/docker-entrypoint.sh"
sed -i '/backwards compat/d' "$dir/Dockerfile"
sed -i -e '/--skip-ssl/d' \
"$dir"/healthcheck.sh
;;
*)
sed -i -e '/^CMD/s/mysqld/mariadbd/' \
Expand Down Expand Up @@ -130,7 +134,7 @@ update_version()
sed -i -e '/memory\.pressure/,+7d' "$dir/docker-entrypoint.sh"
fi
if [[ $vmin = 10.* || $vmin =~ 11.[12] ]]; then
sed -i -e '/--skip-ssl/d' "$dir/docker-entrypoint.sh"
sed -i -e '/--skip-ssl/d' "$dir/docker-entrypoint.sh" "$dir/healthcheck.sh"
fi
if [[ $vmin =~ 11.[012345] ]]; then
sed -i -e 's/mysql_upgrade_info/mariadb_upgrade_info/' \
Expand Down

0 comments on commit 11135d0

Please sign in to comment.