fix cleanup images for databases

This commit is contained in:
ayntk-ai 2024-08-09 22:25:39 +02:00
parent 16a5c601e3
commit 7d1179e7c8
No known key found for this signature in database

View file

@ -69,11 +69,21 @@ public function handle()
}
if ($this->deleteConfigurations) {
$this->resource?->delete_configurations();
ray('Iam am running now, Configurations should disapear right?');
}
$server = data_get($this->resource, 'server');
if ($this->deleteImages && $server) {
CleanupDocker::run($server, true); //this is run for DBs but it does not work for DBs
$isDatabase = $this->resource instanceof StandalonePostgresql
|| $this->resource instanceof StandaloneRedis
|| $this->resource instanceof StandaloneMongodb
|| $this->resource instanceof StandaloneMysql
|| $this->resource instanceof StandaloneMariadb
|| $this->resource instanceof StandaloneKeydb
|| $this->resource instanceof StandaloneDragonfly
|| $this->resource instanceof StandaloneClickhouse;
$server = data_get($this->resource, 'server') ?? data_get($this->resource, 'destination.server');
if (($this->deleteImages || $isDatabase) && $server) {
CleanupDocker::run($server, true);
ray('I am running now, images should disappear right?');
}
if ($this->deleteConnectedNetworks) {