Skip to content

Commit d28886f

Browse files
wip
Signed-off-by: ivan katliarchuk <[email protected]>
1 parent 7973a88 commit d28886f

File tree

7 files changed

+45
-3
lines changed

7 files changed

+45
-3
lines changed

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ SUPPORTED := chart \
3535
issue-457 \
3636
issue-471 \
3737
issue-494 \
38-
issue-497
38+
issue-497 \
39+
issue-499
3940

40-
ISSUE := issue-494
41+
ISSUE := issue-471
4142

4243
FILTER_FOLDER := $(filter $(folder),$(SUPPORTED))
4344

@@ -91,7 +92,7 @@ unit-test-loop: check-issue ## Execute in the loop. 20 times
9192
((number = number + 1)) ; \
9293
done
9394

94-
template: ## Helm template to validate
95+
template-set: ## Helm template to validate
9596
$(info Running helm template for $(ISSUE)...)
9697
@helm template namespaces $(ISSUE) \
9798
--output-dir .output \
@@ -101,6 +102,13 @@ template: ## Helm template to validate
101102
--set hosts[2]=abrakadabra-v2.local \
102103
--set hostsMap[1].attribute=new-attribute1
103104

105+
template: ## Helm template to validate
106+
$(info Running helm template for $(ISSUE)...)
107+
@helm template namespaces $(ISSUE) \
108+
--output-dir .output \
109+
--debug \
110+
--values $(ISSUE)/values.yaml
111+
104112
deps: ## Helm dependencies
105113
@helm dependency build $(ISSUE)
106114

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@
4242

4343
[governance.link-checker.badge]: https://github.com/ik-workshop/helm-unittests-issues/actions/workflows/governance.links-checker.yml/badge.svg
4444
[governance.link-checker.status]: https://github.com/ik-workshop/helm-unittests-issues/actions/workflows/governance.links-checker.yml
45+
46+
`runAsNonRoot` is set to `false` but `runAsUser` is not set to `0`

issue-499/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v2
2+
description: An example chart with customized subchart
3+
name: with-subchart
4+
version: 0.1.0
5+
issueLink: https://github.com/helm-unittest/helm-unittest/issues/499
6+
supportedLinks:
7+
- https://github.com/helm-unittest/helm-unittest/issues/499

issue-499/assets/stack-trace.png

412 KB
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{- fail (printf "`runAsNonRoot` is set to `true` but `runAsUser` is set to `0` (root)") }}

issue-499/tests/empy_test.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
suite: Test empty template
2+
templates:
3+
- validation.yaml
4+
tests:
5+
- it: should fail when No failed document
6+
asserts:
7+
- failedTemplate:
8+
errorMessage: "`runAsNonRoot` is set to `true` but `runAsUser` is set to `0` (root)"
9+
# - failedTemplate:
10+
# errorMessage: "\\\(root\\\)"
11+
# - failedTemplate:
12+
# errorPattern: |-
13+
# \\(root\\)
14+
- failedTemplate:
15+
errorPattern: "`runAsNonRoot` is set to `true` but `runAsUser` is set to `0` (root)"

issue-499/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
hosts:
2+
- chart-example.local
3+
- chart-example.remote
4+
5+
hostsMap:
6+
- name: value0
7+
attribute: attribute0
8+
- name: value1
9+
attribute: attribute1

0 commit comments

Comments
 (0)