diff --git a/multidim-interop/src/compose-runner.ts b/multidim-interop/src/compose-runner.ts index b4e9e28..ee32ea1 100644 --- a/multidim-interop/src/compose-runner.ts +++ b/multidim-interop/src/compose-runner.ts @@ -33,7 +33,9 @@ export async function run(namespace: string, compose: ComposeSpecification, opts await fs.mkdir(dir, { recursive: true }) // Create compose.yaml file - await fs.writeFile(path.join(dir, "compose.yaml"), stringify(compose)) + // Some docker compose environments don't like the name field to have special characters + const sanitizedComposeName = compose?.name.replace(/[^a-zA-Z0-9_-]/g, "_") + await fs.writeFile(path.join(dir, "compose.yaml"), stringify({...compose, name: sanitizedComposeName})) const upFlags: Array = [] if (opts.up.exitCodeFrom) { @@ -66,4 +68,4 @@ export async function run(namespace: string, compose: ComposeSpecification, opts } await fs.rm(dir, { recursive: true, force: true }) } -} \ No newline at end of file +}