Skip to content

Commit

Permalink
Add podLabels to onechart (#83)
Browse files Browse the repository at this point in the history
* Add podLabels to onechart

* add unittest
  • Loading branch information
raz-amir authored Nov 7, 2023
1 parent d66a75e commit c7da3a4
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 2 deletions.
Binary file modified charts/onechart/charts/common-0.4.0.tgz
Binary file not shown.
3 changes: 2 additions & 1 deletion charts/onechart/helm-ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
"schemaIDs": [
"#/properties/podDisruptionBudgetEnabled",
"#/properties/spreadAcrossNodes",
"#/properties/podAnnotations"
"#/properties/podAnnotations",
"#/properties/podLabels"
],
"uiSchema": {},
"metaData": {
Expand Down
3 changes: 3 additions & 0 deletions charts/onechart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spec:
gimlet.io/git-repository: {{ .Values.gitRepository }}
{{- end }}
labels:
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "helm-chart.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
Expand Down
17 changes: 17 additions & 0 deletions charts/onechart/tests/deployment_podlabels_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should set custom labels
set:
podLabels:
label1: val1
label2: val2
asserts:
- equal:
path: spec.template.metadata.labels.label1
value: val1
- equal:
path: spec.template.metadata.labels.label2
value: val2
13 changes: 13 additions & 0 deletions charts/onechart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"nameOverride": "",
"fullnameOverride": "",
"podAnnotations": {},
"podLabels": {},
"podSecurityContext": {
"fsGroup": 999
},
Expand Down Expand Up @@ -189,6 +190,18 @@
"required": [],
"additionalProperties": true
},
"podLabels": {
"$id": "#/properties/podLabels",
"type": "object",
"title": "Pod labels",
"description": "Annotations to place on pods",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"name": {
"$id": "#/properties/name",
"type": "string",
Expand Down
3 changes: 2 additions & 1 deletion charts/onechart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ fullnameOverride: ""

podAnnotations: {}

podLabels: {}

podSecurityContext:
fsGroup: 999

Expand All @@ -39,7 +41,6 @@ nodeSelector: {}

tolerations: []


probe:
enabled: false
path: "/"
Expand Down

0 comments on commit c7da3a4

Please sign in to comment.