mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-27 18:57:09 +00:00
fix(dependency-map): stop flagging env-var bind mounts as missing volumes (#1468)
* fix(dependency-map): stop flagging env-var bind mounts as missing volumes
The Fleet Map "Missing dependencies" anomaly fired false positives for
services whose volumes use env-var-interpolated bind sources such as
${BACKUPS_PATH}:/backups. The compose parser classified the source as a
named volume because the ${VAR} token contains no slash, then the runtime
presence check found no matching volume and flagged it.
A compose named-volume key can never contain $, so any source with an env
var is a bind path whose value is unresolvable at parse time. Exclude it
from named-volume classification.
Closes #1464
* docs(dependency-map): clarify the env-var volume guard comment
Note that the $ check also covers the $$ literal-dollar Compose escape, and
state the named-volume key charset that makes the guard safe. No behavior change.
This commit is contained in:
@@ -66,6 +66,9 @@ function collectKeys(value: unknown): string[] {
|
||||
/** True when a volume source is a named volume (not a bind mount or anonymous). */
|
||||
function isNamedVolumeSource(source: string): boolean {
|
||||
if (!source) return false;
|
||||
// A named-volume key is [a-zA-Z0-9._-]+, so any '$' marks an env-var bind path
|
||||
// (or the '$$' literal-dollar escape) whose value is unresolvable at parse time.
|
||||
if (source.includes('$')) return false;
|
||||
if (source.includes('/')) return false; // bind mount path
|
||||
if (source.startsWith('.') || source.startsWith('~')) return false;
|
||||
if (/^[a-zA-Z]:[\\/]/.test(source)) return false; // Windows drive path
|
||||
|
||||
Reference in New Issue
Block a user