diff --git a/charts/sourcebot/README.md b/charts/sourcebot/README.md index 0ce2568..9bde12f 100644 --- a/charts/sourcebot/README.md +++ b/charts/sourcebot/README.md @@ -22,8 +22,10 @@ Sourcebot is a self-hosted tool that helps you understand your codebase. | Key | Type | Default | Description | |-----|------|---------|-------------| +| additionalLabels | object | `{}` | Add extra labels to all resources | | fullnameOverride | string | `""` | Override the full name of the deployed resources, defaults to a combination of the release name and the name for the selector labels | | global.imagePullSecrets | list | `[]` | Global Docker registry secret names as an array | +| global.metadata | object | `{}` | Global metadata for deployment tooling | | global.security.allowInsecureImages | bool | `true` | Allow insecure images to use bitnami legacy repository. Can be set to false if secure images are being used (Paid). | | nameOverride | string | `""` | Override the name for the selector labels, defaults to the chart name | | postgresql.auth.args | string | `""` | Additional database connection arguments | diff --git a/charts/sourcebot/templates/_helpers.tpl b/charts/sourcebot/templates/_helpers.tpl index 561824f..682a10a 100644 --- a/charts/sourcebot/templates/_helpers.tpl +++ b/charts/sourcebot/templates/_helpers.tpl @@ -40,7 +40,8 @@ helm.sh/chart: {{ include "sourcebot.chart" $ }} app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ $.Release.Service }} -{{- with $.Values.additionalLabels }} +{{- $additionalLabels := mergeOverwrite (dict) (default dict $.Values.sourcebot.additionalLabels) (default dict $.Values.additionalLabels) }} +{{- with $additionalLabels }} {{ toYaml . }} {{- end }} {{- end }} diff --git a/charts/sourcebot/tests/basic_test.yaml b/charts/sourcebot/tests/basic_test.yaml index 023da4c..99fdb57 100644 --- a/charts/sourcebot/tests/basic_test.yaml +++ b/charts/sourcebot/tests/basic_test.yaml @@ -67,6 +67,28 @@ tests: value: Helm template: deployment.yaml + - it: should include root additional labels + values: + - ../values.lint.yaml + set: + additionalLabels.component: sourcebot + asserts: + - equal: + path: metadata.labels.component + value: sourcebot + template: deployment.yaml + + - it: should include sourcebot additional labels + values: + - ../values.lint.yaml + set: + sourcebot.additionalLabels.component: sourcebot + asserts: + - equal: + path: metadata.labels.component + value: sourcebot + template: deployment.yaml + - it: should use correct image when tag is specified values: - ../values.lint.yaml @@ -183,4 +205,3 @@ tests: - isNotEmpty: path: data["config.json"] template: config.yaml - diff --git a/charts/sourcebot/values.schema.json b/charts/sourcebot/values.schema.json index d6a5135..c1630b3 100644 --- a/charts/sourcebot/values.schema.json +++ b/charts/sourcebot/values.schema.json @@ -19,6 +19,9 @@ "imagePullSecrets": { "type": "array", "items": { "type": "string" } + }, + "metadata": { + "type": "object" } } }, @@ -28,6 +31,9 @@ "fullnameOverride": { "type": "string" }, + "additionalLabels": { + "type": "object" + }, "sourcebot": { "type": "object", "additionalProperties": false, diff --git a/charts/sourcebot/values.yaml b/charts/sourcebot/values.yaml index 80229cd..65d5a05 100644 --- a/charts/sourcebot/values.yaml +++ b/charts/sourcebot/values.yaml @@ -8,12 +8,19 @@ global: # -- Global Docker registry secret names as an array imagePullSecrets: [] + # -- Global metadata for deployment tooling + metadata: {} + # -- Override the name for the selector labels, defaults to the chart name nameOverride: "" # -- Override the full name of the deployed resources, defaults to a combination of the release name and the name for the selector labels fullnameOverride: "" +# -- Add extra labels to all resources +additionalLabels: {} +# team: sourcebot + # Core Sourcebot Configuration sourcebot: # -- Set the number of replicas for the deployment