diff --git a/api-nodes/Http/Controllers/EventController.php b/api-nodes/Http/Controllers/EventController.php index 762a6e2..0374cb8 100644 --- a/api-nodes/Http/Controllers/EventController.php +++ b/api-nodes/Http/Controllers/EventController.php @@ -28,6 +28,7 @@ public function started(Node $node, AgentStartedEventData $data) $nodeAddresses = $swarm->nodes->pluck('data.address')->toArray(); $dockerServices = collect($swarm->services) ->filter(function ($service) { + // TODO: use some flags on the service to determine if it should be passed to DIRD return Str::contains($service->docker_name, 'caddy'); }) ->pluck('docker_name') diff --git a/app/Models/Deployment.php b/app/Models/Deployment.php index d30c2fc..ee6029a 100644 --- a/app/Models/Deployment.php +++ b/app/Models/Deployment.php @@ -64,6 +64,8 @@ public function scopeLatestDeployments(EloquentBuilder $query): EloquentBuilder $query ->selectRaw('max("latest_deployments_query"."id")') ->from('deployments', 'latest_deployments_query') + ->join('services', 'services.id', '=', 'latest_deployments_query.service_id') + ->whereNull('services.deleted_at') ->groupBy('latest_deployments_query.service_id'); }); }