mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-04 10:42:23 +00:00
fix(proxy): restore project networks after host reboot (#11476)
This commit is contained in:
1 parent
c1219576cf
commit
16352fad23
2 files changed
+3
-3
No files matched your search
@@ -123,7 +123,7 @@ function connectProxyToNetworks(Server $server)
|
||||
}
|
||||
|
||||
return collect([
|
||||
'for network in $(docker inspect $(docker ps --filter label=coolify.managed=true --format "{{.ID}}") --format=\'{{range $network, $_ := .NetworkSettings.Networks}}{{println $network}}{{end}}\' 2>/dev/null | sort -u); do',
|
||||
'for network in $(docker inspect $(docker ps -a --filter label=coolify.managed=true --format "{{.ID}}") --format=\'{{range $network, $_ := .NetworkSettings.Networks}}{{println $network}}{{end}}\' 2>/dev/null | sort -u); do',
|
||||
' if [ -z "$network" ] || [ "$network" = "bridge" ] || [ "$network" = "host" ] || [ "$network" = "none" ] || [ "$network" = "default" ]; then',
|
||||
' continue',
|
||||
' fi',
|
||||
|
||||
@@ -6,14 +6,14 @@ use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
it('discovers running container networks instead of relying on cached resource statuses', function () {
|
||||
it('discovers managed container networks regardless of container status', function () {
|
||||
$team = Team::factory()->create();
|
||||
$server = Server::factory()->create(['team_id' => $team->id]);
|
||||
|
||||
$commands = connectProxyToNetworks($server)->implode("\n");
|
||||
|
||||
expect($commands)
|
||||
->toContain('docker ps --filter label=coolify.managed=true')
|
||||
->toContain('docker ps -a --filter label=coolify.managed=true')
|
||||
->toContain('.NetworkSettings.Networks')
|
||||
->toContain('docker network inspect "$network"')
|
||||
->toContain('docker network connect "$network" coolify-proxy')
|
||||
|
||||
Reference in new issue
Block a user