diff --git a/garden-service/src/types/plugin/base.ts b/garden-service/src/types/plugin/base.ts index ac7a7adc28..3b1592bfe6 100644 --- a/garden-service/src/types/plugin/base.ts +++ b/garden-service/src/types/plugin/base.ts @@ -85,36 +85,39 @@ export interface RunResult { output?: string } -export const runResultSchema = joi.object().keys({ - moduleName: joi.string().description("The name of the module that was run."), - command: joi - .array() - .items(joi.string()) - .required() - .description("The command that was run in the module."), - version: joi.string().description("The string version of the module."), - success: joi - .boolean() - .required() - .description("Whether the module was successfully run."), - startedAt: joi - .date() - .required() - .description("When the module run was started."), - completedAt: joi - .date() - .required() - .description("When the module run was completed."), - log: joi - .string() - .allow("") - .default("") - .description("The output log from the run."), - output: joi - .string() - .allow("") - .description("[DEPRECATED - use `log` instead] The output log from the run."), -}) +export const runResultSchema = joi + .object() + .unknown(true) + .keys({ + moduleName: joi.string().description("The name of the module that was run."), + command: joi + .array() + .items(joi.string()) + .required() + .description("The command that was run in the module."), + version: joi.string().description("The string version of the module."), + success: joi + .boolean() + .required() + .description("Whether the module was successfully run."), + startedAt: joi + .date() + .required() + .description("When the module run was started."), + completedAt: joi + .date() + .required() + .description("When the module run was completed."), + log: joi + .string() + .allow("") + .default("") + .description("The output log from the run."), + output: joi + .string() + .allow("") + .description("[DEPRECATED - use `log` instead] The output log from the run."), + }) export const artifactsPathSchema = joi .string() diff --git a/garden-service/src/types/plugin/task/getTaskResult.ts b/garden-service/src/types/plugin/task/getTaskResult.ts index 23adbe2de6..2064be2bb4 100644 --- a/garden-service/src/types/plugin/task/getTaskResult.ts +++ b/garden-service/src/types/plugin/task/getTaskResult.ts @@ -20,41 +20,44 @@ export interface GetTaskResultParams<T extends Module = Module> extends PluginTa taskVersion: ModuleVersion } -export const taskResultSchema = joi.object().keys({ - moduleName: joi.string().description("The name of the module that the task belongs to."), - taskName: joi.string().description("The name of the task that was run."), - command: joi - .array() - .items(joi.string()) - .required() - .description("The command that the task ran in the module."), - version: joi.string().description("The string version of the task."), - success: joi - .boolean() - .required() - .description("Whether the task was successfully run."), - startedAt: joi - .date() - .required() - .description("When the task run was started."), - completedAt: joi - .date() - .required() - .description("When the task run was completed."), - log: joi - .string() - .required() - .allow("") - .description("The output log from the run."), - output: joi - .string() - .allow("") - .description("[DEPRECATED - use `log` instead] The output log from the run."), - outputs: joi - .object() - .pattern(/.+/, joiPrimitive()) - .description("A map of primitive values, output from the task."), -}) +export const taskResultSchema = joi + .object() + .unknown(true) + .keys({ + moduleName: joi.string().description("The name of the module that the task belongs to."), + taskName: joi.string().description("The name of the task that was run."), + command: joi + .array() + .items(joi.string()) + .required() + .description("The command that the task ran in the module."), + version: joi.string().description("The string version of the task."), + success: joi + .boolean() + .required() + .description("Whether the task was successfully run."), + startedAt: joi + .date() + .required() + .description("When the task run was started."), + completedAt: joi + .date() + .required() + .description("When the task run was completed."), + log: joi + .string() + .required() + .allow("") + .description("The output log from the run."), + output: joi + .string() + .allow("") + .description("[DEPRECATED - use `log` instead] The output log from the run."), + outputs: joi + .object() + .pattern(/.+/, joiPrimitive()) + .description("A map of primitive values, output from the task."), + }) export const getTaskResult = { description: dedent`