v0.41.2: fix controller-route auto-connect + dead dashboard cross-drive block
containerOnNetwork misread the absent-key '<nil>' as "already attached", so wireController skipped docker network connect -> traefik 502'd felhom.<domain>. Now lists network names and matches exactly. Also removed dashboard.html's dead CrossDrive* block (slice-8C leftover) that 500'd the dashboard via gt <nil> 0, exposed once v0.41.1 made the dashboard reachable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -188,14 +188,20 @@ func (m *Manager) wireController(traefikDir string) error {
|
||||
}
|
||||
|
||||
// containerOnNetwork reports whether the named container is attached to the given docker network.
|
||||
// We list the network names and match exactly — NOT `{{index .Networks "name"}}`, whose output for an
|
||||
// absent key is "<nil>" (a non-empty string), which would falsely read as "already attached".
|
||||
func containerOnNetwork(name, network string) bool {
|
||||
out, err := exec.Command("docker", "inspect", "--format",
|
||||
fmt.Sprintf("{{index .NetworkSettings.Networks %q}}", network), name).Output()
|
||||
"{{range $k, $_ := .NetworkSettings.Networks}}{{$k}}\n{{end}}", name).Output()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
s := strings.TrimSpace(string(out))
|
||||
return s != "" && s != "<no value>"
|
||||
for _, n := range strings.Fields(string(out)) {
|
||||
if n == network {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// ensureTraefikNetwork creates the external traefik-public docker network if absent (idempotent;
|
||||
|
||||
Reference in New Issue
Block a user