From 25a0489f7f70b44f1cf4857e62f72cf81ac612d9 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 22 Nov 2023 14:21:03 +0100 Subject: [PATCH 1/2] Fix log drain issue in advanced and service application --- app/Http/Livewire/Project/Application/Advanced.php | 2 +- app/Http/Livewire/Project/Service/Application.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Livewire/Project/Application/Advanced.php b/app/Http/Livewire/Project/Application/Advanced.php index 552a3873a..656c55717 100644 --- a/app/Http/Livewire/Project/Application/Advanced.php +++ b/app/Http/Livewire/Project/Application/Advanced.php @@ -23,7 +23,7 @@ class Advanced extends Component ]; public function instantSave() { - if ($this->application->settings->is_log_drain_enabled) { + if ($this->application->isLogDrainEnabled()) { if (!$this->application->destination->server->isLogDrainEnabled()) { $this->application->settings->is_log_drain_enabled = false; $this->emit('error', 'Log drain is not enabled on this server.'); diff --git a/app/Http/Livewire/Project/Service/Application.php b/app/Http/Livewire/Project/Service/Application.php index 8a785b9c6..14fd3d5ab 100644 --- a/app/Http/Livewire/Project/Service/Application.php +++ b/app/Http/Livewire/Project/Service/Application.php @@ -28,7 +28,12 @@ public function instantSave() } public function instantSaveAdvanced() { - $this->submit(); + if (!$this->application->service->destination->server->isLogDrainEnabled()) { + $this->application->is_log_drain_enabled = false; + $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.'); + return; + } + $this->application->save(); $this->emit('success', 'You need to restart the service for the changes to take effect.'); } public function delete() @@ -49,11 +54,6 @@ public function submit() { try { $this->validate(); - if (!$this->application->service->destination->server->isLogDrainEnabled()) { - $this->application->is_log_drain_enabled = false; - $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.'); - return; - } $this->application->save(); updateCompose($this->application); $this->emit('success', 'Application saved successfully.'); From 6ccbf911b2e13c40d28e4384bc253559c5bcd454 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 22 Nov 2023 14:25:55 +0100 Subject: [PATCH 2/2] Fix condition for pushing to Docker registry --- app/Jobs/ApplicationDeploymentJob.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 77c8bd13f..1dcd51b22 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -219,7 +219,7 @@ public function handle(): void if ($this->server->isProxyShouldRun()) { dispatch(new ContainerStatusJob($this->server)); } - if ($this->application->docker_registry_image_name) { + if ($this->application->docker_registry_image_name && $this->application->build_pack !== 'dockerimage') { $this->push_to_docker_registry(); } $this->next(ApplicationDeploymentStatus::FINISHED->value);