@rophy123/helmtest 2.1.3 → 2.1.5
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/bin/helmtest +2 -3
- package/bin/setup.js +2 -0
- package/lib/helmtest.js +5 -4
- package/package.json +1 -1
- package/Makefile +0 -13
package/bin/helmtest
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const path = require('path');
|
|
4
|
-
const helmtest = require('../lib/helmtest');
|
|
5
4
|
|
|
6
5
|
let jest;
|
|
7
6
|
|
|
@@ -16,8 +15,6 @@ try {
|
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
globalThis.helmtest = helmtest;
|
|
20
|
-
|
|
21
18
|
jest.run([
|
|
22
19
|
'--testMatch',
|
|
23
20
|
'**/*.js',
|
|
@@ -25,4 +22,6 @@ jest.run([
|
|
|
25
22
|
__dirname,
|
|
26
23
|
'--roots',
|
|
27
24
|
path.join(process.cwd(), 'tests'),
|
|
25
|
+
'--setupFilesAfterEnv',
|
|
26
|
+
path.join(__dirname, '/setup.js')
|
|
28
27
|
]);
|
package/bin/setup.js
ADDED
package/lib/helmtest.js
CHANGED
|
@@ -21,9 +21,10 @@ async function renderTemplate(options = {}) {
|
|
|
21
21
|
options.templateFiles = options.templateFiles || [];
|
|
22
22
|
options.extraHelmArgs = options.extraHelmArgs || [];
|
|
23
23
|
options.helmBinary = options.helmBinary || process.env.HELM_BINARY || 'helm';
|
|
24
|
-
options.loadYaml
|
|
25
|
-
options.kubeconformEnabled
|
|
26
|
-
process.env.KUBECONFORM_ENABLED || false;
|
|
24
|
+
if (options.loadYaml === undefined) options.loadYaml = true;
|
|
25
|
+
if (options.kubeconformEnabled === undefined) {
|
|
26
|
+
options.kubeconformEnabled = process.env.KUBECONFORM_ENABLED || false;
|
|
27
|
+
}
|
|
27
28
|
options.kubeconformBinary = options.kubeconformBinary ||
|
|
28
29
|
process.env.KUBECONFORM_BINARY || 'kubeconform';
|
|
29
30
|
options.kubeconformArgs = options.kubeconformArgs ||
|
|
@@ -103,7 +104,7 @@ async function renderTemplate(options = {}) {
|
|
|
103
104
|
if (options.loadYaml) {
|
|
104
105
|
return yaml.loadAll(helmOutput.stdout);
|
|
105
106
|
} else {
|
|
106
|
-
return helmOutput;
|
|
107
|
+
return helmOutput.stdout;
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
|
package/package.json
CHANGED
package/Makefile
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
.PHONY: help test
|
|
2
|
-
|
|
3
|
-
help: ## Show this help.
|
|
4
|
-
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
|
|
5
|
-
|
|
6
|
-
test: ## Run unit tests.
|
|
7
|
-
docker run -t --rm -e DEBUG=helmtest -v `pwd`:/workspace rophy/helmtest
|
|
8
|
-
|
|
9
|
-
build: ## Build docker image.
|
|
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
|