Skip to content

Commit

Permalink
Better healthcheck for arm mariadb service.
Browse files Browse the repository at this point in the history
  • Loading branch information
reynoldsalec committed Jan 12, 2024
1 parent 0418d71 commit aca93f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builders/pantheon-mariadb-arm.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = {
password: 'pantheon',
user: 'pantheon',
},
healthcheck: 'mysql -uroot --silent --execute "SHOW DATABASES;"',
port: '3306',
defaultFiles: {
database: 'my_custom.cnf',
Expand All @@ -41,6 +40,8 @@ module.exports = {
// Change the me user
options.meUser = 'mysql';

if (!options.healthcheck) options.healthcheck = require('../utils/get-mariadb-healthcheck')(options);

const mariadb = {
image: `mariadb:${options.version}`,
command: 'docker-entrypoint.sh mysqld',
Expand Down
15 changes: 15 additions & 0 deletions utils/get-mariadb-healthcheck.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

// checks to see if a setting is disabled
module.exports = options => {
return [
'mysql',
`--host=${options.name}`,
`--user=${options.creds.user}`,
`--database=${options.creds.database}`,
`--password=${options.creds.password}`,
'--silent',
'--execute',
'"SHOW TABLES;"',
].join(' ');
};

0 comments on commit aca93f5

Please sign in to comment.