From 2f4d4b05981585b2c2cad2fc17614df5867af850 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 26 Jan 2024 15:35:23 +0100 Subject: [PATCH] feat(helm): support labels in values.yaml --- CHANGELOG.md | 2 ++ deploy/helm/trino-operator/templates/_helpers.tpl | 3 +++ deploy/helm/trino-operator/templates/deployment.yaml | 2 +- deploy/helm/trino-operator/templates/roles.yaml | 8 +++++++- deploy/helm/trino-operator/values.yaml | 5 ++++- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c26cbb7..753d3baa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - Various documentation of the CRD ([#510]). +- Helm: support labels in values.yaml ([#528]). ### Fixed @@ -14,6 +15,7 @@ All notable changes to this project will be documented in this file. [#510]: https://github.com/stackabletech/trino-operator/pull/510 [#526]: https://github.com/stackabletech/trino-operator/pull/526 +[#528]: https://github.com/stackabletech/trino-operator/pull/528 ## [23.11.0] - 2023-11-24 diff --git a/deploy/helm/trino-operator/templates/_helpers.tpl b/deploy/helm/trino-operator/templates/_helpers.tpl index a2258b27..1096ffc6 100644 --- a/deploy/helm/trino-operator/templates/_helpers.tpl +++ b/deploy/helm/trino-operator/templates/_helpers.tpl @@ -55,6 +55,9 @@ Selector labels {{- define "operator.selectorLabels" -}} app.kubernetes.io/name: {{ include "operator.appname" . }} app.kubernetes.io/instance: {{ .Release.Name }} +{{- with .Values.labels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/deploy/helm/trino-operator/templates/deployment.yaml b/deploy/helm/trino-operator/templates/deployment.yaml index f60334cd..803f4090 100644 --- a/deploy/helm/trino-operator/templates/deployment.yaml +++ b/deploy/helm/trino-operator/templates/deployment.yaml @@ -23,7 +23,7 @@ spec: labels: {{- include "operator.selectorLabels" . | nindent 8 }} spec: - {{- with .Values.imagePullSecrets }} + {{- with .Values.image.pullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/deploy/helm/trino-operator/templates/roles.yaml b/deploy/helm/trino-operator/templates/roles.yaml index 3149e8d8..55cd7e3e 100644 --- a/deploy/helm/trino-operator/templates/roles.yaml +++ b/deploy/helm/trino-operator/templates/roles.yaml @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ include "operator.fullname" . }}-clusterrole + labels: + {{- include "operator.labels" . | nindent 4 }} rules: # For OPA dependents. Note that OPA it's self is listed here because it's own resource name # doesn't follow the *clusters convention @@ -160,6 +162,8 @@ apiVersion: security.openshift.io/v1 kind: SecurityContextConstraints metadata: name: trino-scc + labels: + {{- include "operator.labels" . | nindent 4 }} annotations: kubernetes.io/description: |- This resource is derived from hostmount-anyuid. It provides all the features of the @@ -203,6 +207,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ include "operator.name" . }}-clusterrole + labels: + {{- include "operator.labels" . | nindent 4 }} rules: - apiGroups: - "" @@ -227,4 +233,4 @@ rules: - trino-scc verbs: - use -{{ end }} \ No newline at end of file +{{ end }} diff --git a/deploy/helm/trino-operator/values.yaml b/deploy/helm/trino-operator/values.yaml index d212de43..83872dcf 100644 --- a/deploy/helm/trino-operator/values.yaml +++ b/deploy/helm/trino-operator/values.yaml @@ -3,8 +3,8 @@ image: repository: docker.stackable.tech/stackable/trino-operator pullPolicy: IfNotPresent + pullSecrets: [] -imagePullSecrets: [] nameOverride: "" fullnameOverride: "" @@ -19,6 +19,9 @@ serviceAccount: podAnnotations: {} +# Provide additional labels which get attached to all deployed resources +labels: {} + podSecurityContext: {} # fsGroup: 2000