mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-24 00:27:47 +00:00
fix(proxy): set Traefik network labels for compose services
Add the Coolify network label when no user-selected Traefik network exists, while preserving custom labels for applications and services.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
it('adds the Coolify network when the user did not select a Traefik network', function () {
|
||||
$labels = addTraefikDockerNetworkLabel(collect([
|
||||
'traefik.enable=true',
|
||||
]), 'app-uuid');
|
||||
|
||||
expect($labels->values()->all())->toContain('traefik.docker.network=app-uuid');
|
||||
});
|
||||
|
||||
it('preserves a user-selected Traefik network', function () {
|
||||
$labels = addTraefikDockerNetworkLabel(collect([
|
||||
'traefik.enable=true',
|
||||
'traefik.docker.network=custom-network',
|
||||
]), 'app-uuid');
|
||||
|
||||
expect($labels->values()->all())
|
||||
->toContain('traefik.docker.network=custom-network')
|
||||
->not->toContain('traefik.docker.network=app-uuid');
|
||||
});
|
||||
|
||||
it('treats a bare user-provided Traefik network label as authoritative', function () {
|
||||
$labels = addTraefikDockerNetworkLabel(collect([
|
||||
'traefik.docker.network',
|
||||
]), 'app-uuid');
|
||||
|
||||
expect($labels->values()->all())
|
||||
->toContain('traefik.docker.network')
|
||||
->not->toContain('traefik.docker.network=app-uuid');
|
||||
});
|
||||
Reference in New Issue
Block a user