Skip to content

Commit d6cf85c

Browse files
authored
Merge pull request #73 from VLZZZ/improve-helm-chart
2 parents 5047e63 + 4e8dfc9 commit d6cf85c

File tree

8 files changed

+67
-1
lines changed

8 files changed

+67
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ helm repo update
9393
helm search repo pag -l
9494
```
9595

96+
### Helm Chart Unit Tests
97+
98+
Helm plugin [quintush/helm-unittest](https://github.com/quintush/helm-unittest) is used for unit-testing.
99+
After installing the plugin run `helm unittest <chart_dir>`. For Helm 3 support use `--helm3` flag.
100+
More information on writing tests might be found in the plugin's project repo.
101+
96102
## Contributing
97103
To run the server you can run:
98104

charts/prom-aggregation-gateway/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: prom-aggregation-gateway
3-
version: 0.5.4
3+
version: 0.6.0
44
home: https://github.com/zapier/prom-aggregation-gateway
55
maintainers:
66
- name: djeebus

charts/prom-aggregation-gateway/templates/podmonitor.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ apiVersion: monitoring.coreos.com/v1
33
kind: PodMonitor
44
metadata:
55
name: {{ .Release.Name }}-metrics
6+
{{- with .Values.podMonitor.additionalLabels }}
7+
labels:
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
610
spec:
711
selector:
812
matchLabels:

charts/prom-aggregation-gateway/templates/servicemonitor.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ apiVersion: monitoring.coreos.com/v1
33
kind: ServiceMonitor
44
metadata:
55
name: {{ .Release.Name }}
6+
{{- with .Values.serviceMonitor.additionalLabels }}
7+
labels:
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
610
spec:
711
selector:
812
matchLabels:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
suite: PodMonitor tests
2+
3+
templates: [podmonitor.yaml]
4+
5+
tests:
6+
- it: empty podmonitor labels by default
7+
asserts:
8+
- isEmpty:
9+
path: metadata.labels
10+
- it: can render podmonitor labels
11+
set:
12+
podMonitor:
13+
additionalLabels:
14+
hello: world
15+
goodbye: moon
16+
asserts:
17+
- equal:
18+
path: metadata.labels
19+
value:
20+
hello: world
21+
goodbye: moon
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
suite: ServiceMonitor tests
2+
3+
templates: [servicemonitor.yaml]
4+
5+
tests:
6+
- it: empty servicemonitor labels by default
7+
asserts:
8+
- isEmpty:
9+
path: metadata.labels
10+
- it: can render servicemonitor labels
11+
set:
12+
serviceMonitor:
13+
additionalLabels:
14+
hello: world
15+
goodbye: moon
16+
asserts:
17+
- equal:
18+
path: metadata.labels
19+
value:
20+
hello: world
21+
goodbye: moon

charts/prom-aggregation-gateway/values.schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
"properties": {
9292
"create": {
9393
"type": "boolean"
94+
},
95+
"additionalLabels": {
96+
"type": "object",
97+
"additionalProperties": true
9498
}
9599
}
96100
},
@@ -100,6 +104,10 @@
100104
"properties": {
101105
"create": {
102106
"type": "boolean"
107+
},
108+
"additionalLabels": {
109+
"type": "object",
110+
"additionalProperties": true
103111
}
104112
}
105113
}

charts/prom-aggregation-gateway/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ controller:
1919

2020
podMonitor:
2121
create: true
22+
additionalLabels: {}
2223

2324
service:
2425
create: true
@@ -29,3 +30,4 @@ service:
2930

3031
serviceMonitor:
3132
create: true
33+
additionalLabels: {}

0 commit comments

Comments
 (0)