Fix PostgREST misclassification and empty Domains section (#7442)

This commit is contained in:
Andras Bacsai
2025-12-04 14:53:36 +01:00
committed by GitHub
4 changed files with 103 additions and 2 deletions

View File

@@ -48,6 +48,8 @@ const DATABASE_DOCKER_IMAGES = [
'influxdb',
'clickhouse/clickhouse-server',
'timescaledb/timescaledb',
'timescaledb', // Matches timescale/timescaledb
'timescaledb-ha', // Matches timescale/timescaledb-ha
'pgvector/pgvector',
];
const SPECIFIC_SERVICES = [

View File

@@ -770,10 +770,26 @@ function isDatabaseImage(?string $image = null, ?array $serviceConfig = null)
}
$imageName = $image->before(':');
// First check if it's a known database image
// Extract base image name (ignore registry prefix)
// Examples:
// docker.io/library/postgres -> postgres
// ghcr.io/postgrest/postgrest -> postgrest
// postgres -> postgres
// postgrest/postgrest -> postgrest
$baseImageName = $imageName;
if (str($imageName)->contains('/')) {
$baseImageName = str($imageName)->afterLast('/');
}
// Check if base image name exactly matches a known database image
$isKnownDatabase = false;
foreach (DATABASE_DOCKER_IMAGES as $database_docker_image) {
if (str($imageName)->contains($database_docker_image)) {
// Extract base name from database pattern for comparison
$databaseBaseName = str($database_docker_image)->contains('/')
? str($database_docker_image)->afterLast('/')
: $database_docker_image;
if ($baseImageName == $databaseBaseName) {
$isKnownDatabase = true;
break;
}