Fix: Remove content from docker_compose_raw to prevent file overwrites
When users define volumes with content: in compose files, the content was being removed from docker_compose but not docker_compose_raw. This caused files to be overwritten on every deployment/save when users edited the compose file. Now both docker_compose and docker_compose_raw are updated with the cleaned version (without content:), allowing users to freely edit files in the persistent storage view without them being overwritten. The content: field now acts as an initial value only - it creates the file on first deployment, then is removed so users have full control over file contents. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b0026b3be8
commit
a956e11b3e
1 changed files with 10 additions and 2 deletions
|
|
@ -1297,7 +1297,11 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int
|
|||
return array_search($key, $customOrder);
|
||||
});
|
||||
|
||||
$resource->docker_compose = Yaml::dump(convertToArray($topLevel), 10, 2);
|
||||
$cleanedCompose = Yaml::dump(convertToArray($topLevel), 10, 2);
|
||||
$resource->docker_compose = $cleanedCompose;
|
||||
// Also update docker_compose_raw to remove content: from volumes
|
||||
// This prevents content from being reapplied on subsequent deployments
|
||||
$resource->docker_compose_raw = $cleanedCompose;
|
||||
data_forget($resource, 'environment_variables');
|
||||
data_forget($resource, 'environment_variables_preview');
|
||||
$resource->save();
|
||||
|
|
@ -2220,7 +2224,11 @@ function serviceParser(Service $resource): Collection
|
|||
return array_search($key, $customOrder);
|
||||
});
|
||||
|
||||
$resource->docker_compose = Yaml::dump(convertToArray($topLevel), 10, 2);
|
||||
$cleanedCompose = Yaml::dump(convertToArray($topLevel), 10, 2);
|
||||
$resource->docker_compose = $cleanedCompose;
|
||||
// Also update docker_compose_raw to remove content: from volumes
|
||||
// This prevents content from being reapplied on subsequent deployments
|
||||
$resource->docker_compose_raw = $cleanedCompose;
|
||||
data_forget($resource, 'environment_variables');
|
||||
data_forget($resource, 'environment_variables_preview');
|
||||
$resource->save();
|
||||
|
|
|
|||
Loading…
Reference in a new issue