mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-31 12:48:10 +00:00
fix(drift): resolve explicit network names that equal compose keys (#1588)
Compare runtimeResourceName against the project-prefixed default instead
of the compose key so networks like tailscale: { name: tailscale } are
not mis-resolved as network_tailscale in Drift, Fleet summary, and preflight.
Fixes #1581
This commit is contained in:
@@ -127,10 +127,16 @@ describe('assembleStackNetworkFacts', () => {
|
||||
describe('runtimeResourceName', () => {
|
||||
it('uses a name override, else the project prefix', () => {
|
||||
expect(runtimeResourceName('myapp', 'backend', undefined)).toBe('myapp_backend');
|
||||
expect(runtimeResourceName('myapp', 'backend', 'backend')).toBe('myapp_backend'); // name == key is not an override
|
||||
expect(runtimeResourceName('myapp', 'backend', 'myapp_backend')).toBe('myapp_backend');
|
||||
expect(runtimeResourceName('myapp', 'backend', 'backend')).toBe('backend');
|
||||
expect(runtimeResourceName('myapp', 'shared', 'shared_net')).toBe('shared_net');
|
||||
});
|
||||
|
||||
it('resolves explicit name equal to the compose key (regression: #1581)', () => {
|
||||
expect(runtimeResourceName('network', 'tailscale', 'tailscale')).toBe('tailscale');
|
||||
expect(runtimeResourceName('network', 'proxy', 'proxy')).toBe('proxy');
|
||||
});
|
||||
|
||||
it('never project-prefixes an external resource (runtime name is the key, or a name override)', () => {
|
||||
// Compose references an external network/volume by its real name and never
|
||||
// prefixes the project, so an external resource with no name override keeps
|
||||
|
||||
Reference in New Issue
Block a user