This commit is contained in:
Mateusz Gruszczyński committed 2026-11-14 09:57:21 +01:00
1 parent ad0ff60632
commit 6b59434ffa
60 files changed
+7418 -732

No files matched your search

+14 -3
View File
@@ -80,11 +80,20 @@ func dnsLabel(value string) string {
return out
}
func firstLabel(labels map[string]string, names ...string) string {
for _, name := range names {
if value := strings.TrimSpace(labels[name]); value != "" {
return value
}
}
return ""
}
func serviceIdentity(c dockerContainer, p dockerPort) (key, technical string) {
name := cleanName(c.Names)
project := c.Labels["com.docker.compose.project"]
composeService := c.Labels["com.docker.compose.service"]
replica := c.Labels["com.docker.compose.container-number"]
project := firstLabel(c.Labels, "com.docker.compose.project", "io.podman.compose.project")
composeService := firstLabel(c.Labels, "com.docker.compose.service", "io.podman.compose.service")
replica := firstLabel(c.Labels, "com.docker.compose.container-number", "io.podman.compose.container-number")
if project != "" && composeService != "" {
if replica == "" {
replica = name
@@ -121,6 +130,8 @@ func servicesFrom(containers []dockerContainer) []service {
item = &service{
Key: key, TechnicalName: technical, ContainerID: id, ContainerName: name,
Image: c.Image, PrivatePort: p.PrivatePort, Protocol: p.Type,
Labels: rustproxyLabels(c.Labels),
Container: &containerState{State: strings.ToLower(c.State), Health: healthFromStatus(c.Status)},
}
byKey[key] = item
bindingSeen[key] = make(map[string]struct{})