Skip to content

Commit 4b57a22

Browse files
committed
chore: fix chart lint issues
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent cb3b9dd commit 4b57a22

14 files changed

Lines changed: 126 additions & 64 deletions

File tree

tests/charts/application/Chart.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ dependencies:
22
- name: mysql
33
repository: https://charts.bitnami.com/bitnami
44
version: 14.0.3
5-
digest: sha256:801482030fdbfbb0e9bc66d808541458d0549644d295c43c088203014920c9c9
6-
generated: "2025-08-15T04:17:01.63589655Z"
5+
digest: sha256:80cd59471fc8937944ac535c25f1da52a9820c3f2ed001e3ed741adb41f9e121
6+
generated: "2026-05-18T16:32:39.279673538+02:00"

tests/charts/application/Chart.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ dependencies:
2828
- name: mysql
2929
version: 14.0.3
3030
repository: https://charts.bitnami.com/bitnami
31+
condition: mysql.enabled

tests/charts/application/templates/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kind: ConfigMap
44
apiVersion: v1
55
metadata:
66
name: {{ template "test-application.fullname" . }}-config
7-
namespace: {{ .Values.namespace }}
7+
namespace: {{ .Values.namespace | default "app-system" }}
88
labels:
99
{{- include "test-application.labels" . | nindent 4 }}
1010
data:

tests/charts/application/templates/deployment.yaml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apiVersion: apps/v1
44
kind: Deployment
55
metadata:
66
name: {{ include "test-application.fullname" . }}
7-
namespace: {{ .Values.namespace }}
7+
namespace: {{ .Values.namespace | default "app-system" }}
88
labels:
99
{{- include "test-application.labels" . | nindent 4 }}
1010
spec:
@@ -30,10 +30,7 @@ spec:
3030
{{- end }}
3131
serviceAccountName: {{ include "test-application.serviceAccountName" . }}
3232
securityContext:
33-
runAsNonRoot: true
34-
runAsUser: 101
35-
runAsGroup: 101
36-
fsGroup: 101
33+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
3734
volumes:
3835
- name: cache-nginx
3936
emptyDir: {}
@@ -43,19 +40,14 @@ spec:
4340
emptyDir: {}
4441
containers:
4542
- name: {{ .Chart.Name }}
43+
{{- if .Values.image.digest }}
44+
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}@{{ .Values.image.digest }}"
45+
{{- else }}
4646
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
47+
{{- end }}
4748
imagePullPolicy: {{ .Values.image.pullPolicy }}
4849
securityContext:
49-
privileged: false
50-
allowPrivilegeEscalation: false
51-
readOnlyRootFilesystem: true
52-
seccompProfile:
53-
type: RuntimeDefault
54-
capabilities:
55-
drop:
56-
- ALL
57-
add:
58-
- NET_BIND_SERVICE
50+
{{- toYaml .Values.securityContext | nindent 12 }}
5951
envFrom:
6052
- configMapRef:
6153
name: {{ template "test-application.fullname" . }}-config

tests/charts/application/templates/hpa.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ apiVersion: autoscaling/v2
55
kind: HorizontalPodAutoscaler
66
metadata:
77
name: {{ include "test-application.fullname" . }}
8+
namespace: {{ .Values.namespace | default "app-system" }}
89
labels:
910
{{- include "test-application.labels" . | nindent 4 }}
1011
spec:

tests/charts/application/templates/ingress.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ apiVersion: extensions/v1beta1
1818
kind: Ingress
1919
metadata:
2020
name: {{ $fullName }}
21+
namespace: {{ .Values.namespace | default "app-system" }}
2122
labels:
2223
{{- include "test-application.labels" . | nindent 4 }}
2324
{{- with .Values.ingress.annotations }}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{{- if .Values.networkPolicy.enabled }}
2+
---
3+
apiVersion: networking.k8s.io/v1
4+
kind: NetworkPolicy
5+
metadata:
6+
name: {{ include "test-application.fullname" . }}
7+
namespace: {{ .Values.namespace | default "app-system" }}
8+
labels:
9+
{{- include "test-application.labels" . | nindent 4 }}
10+
spec:
11+
podSelector:
12+
matchLabels:
13+
{{- include "test-application.selectorLabels" . | nindent 6 }}
14+
policyTypes:
15+
- Ingress
16+
- Egress
17+
ingress:
18+
{{- if .Values.networkPolicy.ingress }}
19+
{{- range .Values.networkPolicy.ingress }}
20+
- {{- toYaml . | nindent 6 }}
21+
{{- end }}
22+
{{- else }}
23+
- from:
24+
- namespaceSelector: {}
25+
ports:
26+
- protocol: TCP
27+
port: 8080
28+
{{- end }}
29+
egress:
30+
{{- if .Values.networkPolicy.egress }}
31+
{{- range .Values.networkPolicy.egress }}
32+
- {{- toYaml . | nindent 6 }}
33+
{{- end }}
34+
{{- else }}
35+
- to: []
36+
ports:
37+
- protocol: UDP
38+
port: 53
39+
- protocol: TCP
40+
port: 53
41+
- to:
42+
- podSelector:
43+
matchLabels:
44+
app.kubernetes.io/name: mysql
45+
ports:
46+
- protocol: TCP
47+
port: 3306
48+
- to: []
49+
ports:
50+
- protocol: TCP
51+
port: 80
52+
- protocol: TCP
53+
port: 443
54+
{{- end }}
55+
{{- end }}

tests/charts/application/templates/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: v1
33
kind: Service
44
metadata:
55
name: {{ include "test-application.fullname" . }}
6-
namespace: {{ .Values.namespace }}
6+
namespace: {{ .Values.namespace | default "app-system" }}
77
labels:
88
{{- include "test-application.labels" . | nindent 4 }}
99
spec:

tests/charts/application/templates/serviceaccount.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: v1
33
kind: ServiceAccount
44
metadata:
55
name: {{ include "test-application.serviceAccountName" . }}
6-
namespace: {{ .Values.namespace }}
6+
namespace: {{ .Values.namespace | default "app-system" }}
77
labels:
88
{{- include "test-application.labels" . | nindent 4 }}
99
{{- with .Values.serviceAccount.annotations }}

tests/charts/application/templates/tests/test-connection.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@ apiVersion: v1
44
kind: Pod
55
metadata:
66
name: "{{ include "test-application.fullname" . }}-test-connection"
7-
namespace: {{ .Values.namespace }}
7+
namespace: {{ .Values.namespace | default "app-system" }}
88
labels:
99
{{- include "test-application.labels" . | nindent 4 }}
1010
annotations:
1111
"helm.sh/hook": test
1212
spec:
1313
automountServiceAccountToken: false
1414
securityContext:
15+
seccompProfile:
16+
type: RuntimeDefault
17+
runAsUser: 10001
18+
runAsNonRoot: true
1519
containers:
1620
- name: wget
1721
image: busybox@sha256:9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7
18-
command:
19-
- /bin/sh
20-
- -c
21-
- |
22-
echo "+ testing the application using wget"
23-
set -x
24-
wget -O /dev/null -q '{{ include "test-application.fullname" . }}:{{ .Values.service.port }}'
22+
command: ['wget']
23+
args: ['-O', '/dev/null', '-q', 'http://{{ include "test-application.fullname" . }}:{{ .Values.service.port }}/health/check/']
2524
resources:
2625
limits:
2726
cpu: "100m"

0 commit comments

Comments
 (0)