diff --git a/deploy/helm/charts/loki-rule-operator/Chart.yaml b/deploy/helm/charts/loki-rule-operator/Chart.yaml index 8b8ed8f..a56af3b 100644 --- a/deploy/helm/charts/loki-rule-operator/Chart.yaml +++ b/deploy/helm/charts/loki-rule-operator/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "0.8.0" +version: "0.9.0" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/deploy/helm/charts/loki-rule-operator/templates/_helpers.tpl b/deploy/helm/charts/loki-rule-operator/templates/_helpers.tpl index 7d0b44e..780a98d 100644 --- a/deploy/helm/charts/loki-rule-operator/templates/_helpers.tpl +++ b/deploy/helm/charts/loki-rule-operator/templates/_helpers.tpl @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "loki-rule-operator.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- with .Values.commonLabels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/deploy/helm/charts/loki-rule-operator/tests/global_test.yaml b/deploy/helm/charts/loki-rule-operator/tests/global_test.yaml new file mode 100644 index 0000000..2378d74 --- /dev/null +++ b/deploy/helm/charts/loki-rule-operator/tests/global_test.yaml @@ -0,0 +1,23 @@ +suite: Resources contains commonLabels +templates: +- deployment.yaml +- serviceaccount.yaml +- crd/quero.com_lokirules.yaml +- rbac/cluster_role.yaml +- rbac/leader_election_role.yaml +- rbac/role_bindings.yaml +- rbac/lokirule_viewer_role.yaml +- rbac/lokirule_editor_role.yaml +tests: +- it: should set commonLabels in all resources + values: + - ./minimal_values.yaml + set: + release: + name: my-release + commonLabels: + global.label/name: my-global-label + asserts: + - equal: + path: metadata.labels["global.label/name"] + value: "my-global-label" \ No newline at end of file diff --git a/deploy/helm/charts/loki-rule-operator/values.yaml b/deploy/helm/charts/loki-rule-operator/values.yaml index 92214ed..6bababd 100644 --- a/deploy/helm/charts/loki-rule-operator/values.yaml +++ b/deploy/helm/charts/loki-rule-operator/values.yaml @@ -13,6 +13,9 @@ serviceAccount: podAnnotations: {} +# -- Add additional labels that will be append in all resources. +commonLabels: {} + resources: limits: cpu: 200m