fix: add validation for missing docker compose file

This commit is contained in:
Andras Bacsai 2024-07-15 11:31:18 +02:00
parent a5dd4cab52
commit 43409f3ff0

View File

@ -88,6 +88,9 @@ function updateCompose(ServiceApplication|ServiceDatabase $resource)
try { try {
$name = data_get($resource, 'name'); $name = data_get($resource, 'name');
$dockerComposeRaw = data_get($resource, 'service.docker_compose_raw'); $dockerComposeRaw = data_get($resource, 'service.docker_compose_raw');
if (! $dockerComposeRaw) {
throw new \Exception('No compose file found or not a valid YAML file.');
}
$dockerCompose = Yaml::parse($dockerComposeRaw); $dockerCompose = Yaml::parse($dockerComposeRaw);
// Switch Image // Switch Image