Commented out cleanup_ssh() function

This commit is contained in:
Andras Bacsai 2023-11-29 15:23:03 +01:00
parent 7fe5eca661
commit 3583e552f1

View File

@ -32,7 +32,7 @@ public function handle()
if ($cleanup) {
echo "Running cleanup\n";
$this->cleanup_stucked_resources();
$this->cleanup_ssh();
// $this->cleanup_ssh();
}
$this->cleanup_in_progress_application_deployments();
$this->cleanup_stucked_helper_containers();
@ -63,21 +63,23 @@ private function alive()
echo "Error in alive: {$e->getMessage()}\n";
}
}
private function cleanup_ssh()
{
try {
$files = Storage::allFiles('ssh/keys');
foreach ($files as $file) {
Storage::delete($file);
}
$files = Storage::allFiles('ssh/mux');
foreach ($files as $file) {
Storage::delete($file);
}
} catch (\Throwable $e) {
echo "Error in cleaning ssh: {$e->getMessage()}\n";
}
}
// private function cleanup_ssh()
// {
// TODO: it will cleanup id.root@host.docker.internal
// try {
// $files = Storage::allFiles('ssh/keys');
// foreach ($files as $file) {
// Storage::delete($file);
// }
// $files = Storage::allFiles('ssh/mux');
// foreach ($files as $file) {
// Storage::delete($file);
// }
// } catch (\Throwable $e) {
// echo "Error in cleaning ssh: {$e->getMessage()}\n";
// }
// }
private function cleanup_in_progress_application_deployments()
{
// Cleanup any failed deployments