Skip to content

Commit

Permalink
fix: #143 omit caddy configs for deleted services
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Aug 26, 2024
1 parent 88b21b4 commit 508b935
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions api-nodes/Http/Controllers/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 2 additions & 0 deletions app/Models/Deployment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
}
Expand Down

0 comments on commit 508b935

Please sign in to comment.