Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
34 changes: 21 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion supported-version/dist/index.js

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions supported-version/src/services/build-services.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,22 @@ describe('buildServicesForEntry', () => {
expect(services.mysql.ports).toEqual(['3306:3306']);
});

it('should include mysql health check options', () => {
const entry = createTestEntry();
it('should use healthcheck.sh for mariadb images', () => {
const entry = createTestEntry({ mysql: 'mariadb:11.4' });
const services = buildServicesForEntry(entry);

expect(services.mysql.options).toContain('--health-cmd');
expect(services.mysql.options).toContain('healthcheck.sh --connect --innodb_initialized');
expect(services.mysql.options).not.toContain('mysqladmin');
});

it('should use mysqladmin ping for upstream mysql images', () => {
const entry = createTestEntry({ mysql: 'mysql:8.4' });
const services = buildServicesForEntry(entry);

expect(services.mysql.options).toContain('--health-cmd');
expect(services.mysql.options).toContain('mysqladmin ping');
expect(services.mysql.options).not.toContain('healthcheck.sh');
});
});

Expand Down
7 changes: 6 additions & 1 deletion supported-version/src/services/service-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export interface ServiceTemplate {

export const mysqlConfig: ServiceTemplate = {
getConfig(image: string): ServiceConfig {
// mariadb:11+ no longer ships `mysqladmin`; use the bundled healthcheck.sh
// for MariaDB images, and fall back to `mysqladmin ping` for upstream MySQL.
const healthCmd = image.startsWith('mariadb:')
? 'healthcheck.sh --connect --innodb_initialized'
: 'mysqladmin ping';
return {
image,
env: {
Expand All @@ -15,7 +20,7 @@ export const mysqlConfig: ServiceTemplate = {
MYSQL_ROOT_PASSWORD: 'rootpassword'
},
ports: ['3306:3306'],
options: '--health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3'
options: `--health-cmd="${healthCmd}" --health-interval=10s --health-timeout=5s --health-retries=3`
};
}
};
Expand Down
Loading