Label containers with empty destinations

This will allow us to filter for containers that have no destination in
cases where we deploy an empty + a non empty destination to the same
host.

To note:

```
\# Containers with a destination label
$ docker ps --filter label=destination

\# Containers with an empty destination label
$ docker ps --filter label=destination=
```
This commit is contained in:
Donal McBreen
2024-03-27 14:44:02 +00:00
parent 866303a59b
commit 20e71d91c0
3 changed files with 13 additions and 17 deletions

View File

@@ -176,11 +176,7 @@ class Kamal::Configuration::Role
end
def default_labels
if config.destination
{ "service" => config.service, "role" => name, "destination" => config.destination }
else
{ "service" => config.service, "role" => name }
end
{ "service" => config.service, "role" => name, "destination" => config.destination }
end
def traefik_labels