@rophy123/helmtest 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Makefile CHANGED
@@ -7,4 +7,7 @@ test: ## Run unit tests.
7
7
  docker run -t --rm -e DEBUG=helmtest -v `pwd`:/workspace rophy/helmtest
8
8
 
9
9
  build: ## Build docker image.
10
- docker build -t helmtest .
10
+ docker build -t rophy/helmtest .
11
+
12
+ dev: ## Create a dev container shell
13
+ docker run -it --rm -e DEBUG=helmtest -v `pwd`:/workspace rophy/helmtest bash
package/README.md CHANGED
@@ -80,9 +80,10 @@ helmtest currently only expose one method: `helmtest.renderTemplate(options)`.
80
80
  | releaseName | Release name, the `NAME` arg in helm CLI: `helm template [NAME] [CHART] [flags]`. | `'release-name'` |
81
81
  | values | Map of chart values to set. | `{}` |
82
82
  | valuesFiles | Paths to additional values.yaml. | `[]` |
83
+ | templateFiles | Render only listed template files, e.g. `['templates/hpa.yaml']` | `[]` |
83
84
  | extraHelmArgs | Extra args to pass to helm CLI, e.g. `--timeout=5s` | `[]` |
84
85
  | helmBinary | Path to helm binary. | `process.env.HELM_BINARY \|\| 'helm'` |
85
86
  | loadYaml | if `false`, will return rendered template as raw string instead of js object. | `true` |
86
87
  | kubeconformEnabled | if `true`, will pass rendered template to kubeconform CLI to validate schema. | `process.env.KUBECONFORM_ENABLED \|\| false` |
87
88
  | kubeconformBinary | Path to kubeconform binary. | `process.env.KUBECONFORM_BINARY \|\| 'kubeconform'` |
88
- | kubeconformArgs | Args to pass to kubeconform CLI. Will append `process.env.KUBECONFORM_EXTRA_ARGS`. | `['-strict','-ignore-missing-schemas','-summary']` |
89
+ | kubeconformArgs | Args to pass to kubeconform CLI. Will append `process.env.KUBECONFORM_EXTRA_ARGS`. | `['-strict','-summary']` |
package/lib/helmtest.js CHANGED
@@ -27,11 +27,11 @@ async function renderTemplate(options = {}) {
27
27
  options.kubeconformBinary = options.kubeconformBinary ||
28
28
  process.env.KUBECONFORM_BINARY || 'kubeconform';
29
29
  options.kubeconformArgs = options.kubeconformArgs ||
30
- ['-strict', '-ignore-missing-schemas', '-summary'];
30
+ ['-strict', '-summary'];
31
31
 
32
32
  if (process.env.KUBECONFORM_EXTRA_ARGS) {
33
33
  const kcExtraArgs = process.env.KUBECONFORM_EXTRA_ARGS.split(' ');
34
- options.kubeconformArgs.concat(kcExtraArgs);
34
+ options.kubeconformArgs = options.kubeconformArgs.concat(kcExtraArgs);
35
35
  }
36
36
 
37
37
  debug(`options: ${JSON.stringify(options)}`);
@@ -67,7 +67,7 @@ async function renderTemplate(options = {}) {
67
67
  options.templateFiles.split(',') :
68
68
  options.templateFiles;
69
69
  templateFiles.forEach((templateFile) => {
70
- const filePath = path.join(chartDir, templateFile);
70
+ const filePath = path.join(options.chartDir, templateFile);
71
71
  fs.statSync(filePath);
72
72
  // Note: get the abs template file path to chek it actually exists,
73
73
  // `helm template` command expects relative path from chartDir.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rophy123/helmtest",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "Write unit tests against your helm charts using JavaScript.",
5
5
  "main": "index.js",
6
6
  "bin": {