diff --git a/garden-service/src/config/common.ts b/garden-service/src/config/common.ts index 5778c338f8..47ae66fbaf 100644 --- a/garden-service/src/config/common.ts +++ b/garden-service/src/config/common.ts @@ -200,7 +200,7 @@ export const joiIdentifierMap = (valueSchema: JoiObject) => joi .description("Key/value map. Keys must be valid identifiers.") export const joiVariables = () => joi - .object().pattern(/[\w\d]+/i, joiPrimitive()) + .object().pattern(/[a-zA-Z][a-zA-Z0-9_\-]+/i, joiPrimitive()) .default(() => ({}), "{}") .unknown(false) .description("Key/value map. Keys may contain letters and numbers, and values must be primitives.") diff --git a/garden-service/src/config/module.ts b/garden-service/src/config/module.ts index 8330918b4f..a459bf7599 100644 --- a/garden-service/src/config/module.ts +++ b/garden-service/src/config/module.ts @@ -23,6 +23,7 @@ import { import { TestConfig, TestSpec, testConfigSchema } from "./test" import { TaskConfig, TaskSpec, taskConfigSchema } from "./task" import { DEFAULT_API_VERSION } from "../constants" +import { joiVariables } from "./common" export interface BuildCopySpec { source: string @@ -173,7 +174,7 @@ export interface ModuleConfig export const moduleConfigSchema = baseModuleSpecSchema .keys({ - outputs: joiIdentifierMap(joiPrimitive()) + outputs: joiVariables() .description("The outputs defined by the module (referenceable in other module configs)."), path: joi.string() .description("The filesystem path of the module."), diff --git a/garden-service/src/config/service.ts b/garden-service/src/config/service.ts index 123ea3d0d9..003384399e 100644 --- a/garden-service/src/config/service.ts +++ b/garden-service/src/config/service.ts @@ -7,7 +7,7 @@ */ import deline = require("deline") -import { joiIdentifier, joiIdentifierMap, joiPrimitive, joiArray, joiUserIdentifier, joi } from "./common" +import { joiIdentifier, joiArray, joiUserIdentifier, joi, joiVariables } from "./common" export interface ServiceSpec { } @@ -20,7 +20,7 @@ export interface CommonServiceSpec extends ServiceSpec { dependencies: string[] } -export const serviceOutputsSchema = joiIdentifierMap(joiPrimitive()) +export const serviceOutputsSchema = joiVariables() export const dependenciesSchema = joiArray(joiIdentifier()) .description(deline`