From c5fc53afcd7283df454983c9c261fb2c106a901e Mon Sep 17 00:00:00 2001 From: Jon Edvald Date: Wed, 9 Oct 2019 17:17:16 +0200 Subject: [PATCH] fix(k8s): add missing command argument to helm module test schema We were already accounting for this in the code, was just missing from the validation schema. --- docs/reference/module-types/helm.md | 29 +++++++++++++++++++ .../src/plugins/kubernetes/helm/config.ts | 6 +++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/docs/reference/module-types/helm.md b/docs/reference/module-types/helm.md index 210a7385e6..e4bf76c30c 100644 --- a/docs/reference/module-types/helm.md +++ b/docs/reference/module-types/helm.md @@ -664,6 +664,25 @@ tests: - my-server.js ``` +### `tests[].command[]` + +[tests](#tests) > command + +The command/entrypoint used to run the test inside the container. + +| Type | Required | +| --------------- | -------- | +| `array[string]` | No | + +Example: + +```yaml +tests: + - command: + - /bin/sh + - '-c' +``` + ### `tests[].args[]` [tests](#tests) > args @@ -674,6 +693,15 @@ The arguments to pass to the pod used for testing. | --------------- | -------- | | `array[string]` | No | +Example: + +```yaml +tests: + - args: + - npm + - test +``` + ### `tests[].env` [tests](#tests) > env @@ -791,6 +819,7 @@ tests: containerName: containerModule: hotReloadArgs: + command: args: env: {} timeout: 300 diff --git a/garden-service/src/plugins/kubernetes/helm/config.ts b/garden-service/src/plugins/kubernetes/helm/config.ts index aaca0af4ba..a460763900 100644 --- a/garden-service/src/plugins/kubernetes/helm/config.ts +++ b/garden-service/src/plugins/kubernetes/helm/config.ts @@ -126,8 +126,12 @@ export const execTestSchema = baseTestSpecSchema If not specified, the \`serviceResource\` configured on the module will be used. If neither is specified, an error will be thrown.`, ), + command: joi.array().items(joi.string()) + .description("The command/entrypoint used to run the test inside the container.") + .example([commandExample, {}]), args: joi.array().items(joi.string()) - .description("The arguments to pass to the pod used for testing."), + .description("The arguments to pass to the pod used for testing.") + .example([["npm", "test"], {}]), env: containerEnvVarsSchema, })