Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add(helm): use commonLabels in chart #34

Merged
merged 5 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/helm/charts/loki-rule-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions deploy/helm/charts/loki-rule-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

{{/*
Expand Down
23 changes: 23 additions & 0 deletions deploy/helm/charts/loki-rule-operator/tests/global_test.yaml
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 3 additions & 0 deletions deploy/helm/charts/loki-rule-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ serviceAccount:

podAnnotations: {}

# -- Add additional labels that will be append in all resources.
commonLabels: {}
VitoriaOrtega marked this conversation as resolved.
Show resolved Hide resolved

resources:
limits:
cpu: 200m
Expand Down
Loading