Merge pull request #1625 from nextcloud/revert-1603-enh/noid/refactor-volumes

Revert "substitute volume variables in dockeractionmanager"
This commit is contained in:
Simon L 2022-12-29 11:31:12 +01:00 committed by GitHub
commit 9a9f16ec2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 34 deletions

View file

@ -94,6 +94,39 @@ class ContainerDefinitionFetcher
$volumes = new ContainerVolumes();
foreach ($entry['volumes'] as $value) {
if($value['name'] === '%BORGBACKUP_HOST_LOCATION%') {
$value['name'] = $this->configurationManager->GetBorgBackupHostLocation();
if($value['name'] === '') {
continue;
}
}
if($value['name'] === '%NEXTCLOUD_MOUNT%') {
$value['name'] = $this->configurationManager->GetNextcloudMount();
if($value['name'] === '') {
continue;
}
} elseif ($value['name'] === '%NEXTCLOUD_DATADIR%') {
$value['name'] = $this->configurationManager->GetNextcloudDatadirMount();
if ($value['name'] === '') {
continue;
}
} elseif ($value['name'] === '%DOCKER_SOCKET_PATH%') {
$value['name'] = $this->configurationManager->GetDockerSocketPath();
if($value['name'] === '') {
continue;
}
} elseif ($value['name'] === '%NEXTCLOUD_TRUSTED_CACERTS_DIR%') {
$value['name'] = $this->configurationManager->GetTrustedCacertsDir();
if($value['name'] === '') {
continue;
}
}
if ($value['location'] === '%NEXTCLOUD_MOUNT%') {
$value['location'] = $this->configurationManager->GetNextcloudMount();
if($value['location'] === '') {
continue;
}
}
$volumes->AddVolume(
new ContainerVolume(
$value['name'],

View file

@ -205,40 +205,6 @@ class DockerActionManager
public function CreateContainer(Container $container) : void {
$volumes = [];
foreach($container->GetVolumes()->GetVolumes() as $volume) {
if($volume->name === '%BORGBACKUP_HOST_LOCATION%') {
$volume->name = $this->configurationManager->GetBorgBackupHostLocation();
if($volume->name === '') {
continue;
}
}
if($volume->name === '%NEXTCLOUD_MOUNT%') {
$volume->name = $this->configurationManager->GetNextcloudMount();
if($volume->name === '') {
continue;
}
} elseif ($volume->name === '%NEXTCLOUD_DATADIR%') {
$volume->name = $this->configurationManager->GetNextcloudDatadirMount();
if ($volume->name === '') {
continue;
}
} elseif ($volume->name === '%DOCKER_SOCKET_PATH%') {
$volume->name = $this->configurationManager->GetDockerSocketPath();
if($volume->name === '') {
continue;
}
} elseif ($volume->name === '%NEXTCLOUD_TRUSTED_CACERTS_DIR%') {
$volume->name = $this->configurationManager->GetTrustedCacertsDir();
if($volume->name === '') {
continue;
}
}
if ($volume->mountPoint === '%NEXTCLOUD_MOUNT%') {
$volume->mountPoint = $this->configurationManager->GetNextcloudMount();
if($volume->mountPoint === '') {
continue;
}
}
$volumeEntry = $volume->name . ':' . $volume->mountPoint;
if($volume->isWritable) {
$volumeEntry = $volumeEntry . ':' . 'rw';