From 1e4a5de3b3eae3c89220110e99e19e02bc73e361 Mon Sep 17 00:00:00 2001 From: "Timothy J. Miller" Date: Tue, 20 Jul 2021 12:51:04 -0500 Subject: [PATCH 1/3] fix extraLabels indentation --- chart/templates/bigbang/configmap-proxy.yaml | 10 +++++----- chart/templates/bigbang/configmap-sso.yaml | 10 +++++----- chart/templates/bigbang/license.yaml | 12 ++++++------ chart/templates/bigbang/secret.yaml | 10 +++++----- chart/templates/configmap-properties.yaml | 12 ++++++------ chart/templates/configmap.yaml | 12 ++++++------ chart/templates/deployment.yaml | 8 ++++---- chart/templates/ingress.yaml | 10 +++++----- chart/templates/psp-clusterrole.yaml | 6 ++++-- chart/templates/psp-rolebinding.yaml | 6 ++++-- chart/templates/psp.yaml | 4 +++- chart/templates/pv.yaml | 10 +++++----- chart/templates/pvc.yaml | 10 +++++----- chart/templates/service.yaml | 10 +++++----- chart/templates/serviceaccount.yaml | 8 ++++---- chart/values.yaml | 2 ++ 16 files changed, 74 insertions(+), 66 deletions(-) diff --git a/chart/templates/bigbang/configmap-proxy.yaml b/chart/templates/bigbang/configmap-proxy.yaml index e3bdc66..a38c323 100644 --- a/chart/templates/bigbang/configmap-proxy.yaml +++ b/chart/templates/bigbang/configmap-proxy.yaml @@ -4,11 +4,11 @@ kind: ConfigMap metadata: name: {{ template "nexus.name" . }}-proxy labels: {{- include "nexus.labels" . | nindent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} data: proxy: {{ .Values.proxy.request | toJson | quote }} {{- end }} diff --git a/chart/templates/bigbang/configmap-sso.yaml b/chart/templates/bigbang/configmap-sso.yaml index 6230c5c..2eac574 100644 --- a/chart/templates/bigbang/configmap-sso.yaml +++ b/chart/templates/bigbang/configmap-sso.yaml @@ -4,11 +4,11 @@ kind: ConfigMap metadata: name: {{ template "nexus.name" . }}-sso labels: {{- include "nexus.labels" . | nindent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} data: idp-metadata: {{ .Values.sso.idp_data | toJson | quote }} #realm: {{ .Values.sso.realm | quote }} diff --git a/chart/templates/bigbang/license.yaml b/chart/templates/bigbang/license.yaml index ffab010..f33d48e 100644 --- a/chart/templates/bigbang/license.yaml +++ b/chart/templates/bigbang/license.yaml @@ -5,11 +5,11 @@ metadata: name: {{ template "nexus.name" . }}-license labels: {{ include "nexus.labels" . | indent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} data: {{ include "nexus.licenseKey" . | indent 2 }} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/chart/templates/bigbang/secret.yaml b/chart/templates/bigbang/secret.yaml index 78c07b3..8981d98 100644 --- a/chart/templates/bigbang/secret.yaml +++ b/chart/templates/bigbang/secret.yaml @@ -13,11 +13,11 @@ metadata: name: {{ template "nexus.name" . }}-secret labels: {{ include "nexus.labels" . | indent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} data: admin.password: {{ $nexusAdminPass }} admin.username: YWRtaW4K diff --git a/chart/templates/configmap-properties.yaml b/chart/templates/configmap-properties.yaml index 78cf7fb..39a8bcc 100644 --- a/chart/templates/configmap-properties.yaml +++ b/chart/templates/configmap-properties.yaml @@ -4,11 +4,11 @@ kind: ConfigMap metadata: name: {{ template "nexus.name" . }}-properties labels: {{- include "nexus.labels" . | nindent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} data: nexus.properties: | {{- $data := dict -}} @@ -20,4 +20,4 @@ data: {{- range $k, $v := $data }} {{ $k }}={{ $v }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/chart/templates/configmap.yaml b/chart/templates/configmap.yaml index 55418b1..c4dcd63 100644 --- a/chart/templates/configmap.yaml +++ b/chart/templates/configmap.yaml @@ -5,11 +5,11 @@ metadata: name: {{ template "nexus.name" . }}-conf labels: {{ include "nexus.labels" . | indent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} data: {{ toYaml .Values.config.data | indent 2 }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index c678ca3..6072e44 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -4,11 +4,11 @@ metadata: name: {{ template "nexus.fullname" . }} labels: {{ include "nexus.labels" . | indent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} {{- end }} +{{- end }} {{- if .Values.deployment.annotations }} annotations: {{ toYaml .Values.deployment.annotations | indent 4 }} diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml index 2711a21..c54db04 100644 --- a/chart/templates/ingress.yaml +++ b/chart/templates/ingress.yaml @@ -8,11 +8,11 @@ metadata: name: {{ $fullName }} labels: {{- include "nexus.labels" . | nindent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/chart/templates/psp-clusterrole.yaml b/chart/templates/psp-clusterrole.yaml index a810a4f..3a55907 100644 --- a/chart/templates/psp-clusterrole.yaml +++ b/chart/templates/psp-clusterrole.yaml @@ -3,9 +3,11 @@ apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: labels: {{- include "nexus.labels" . | nindent 4 }} +{{- if .Values.nexus.extraLabels }} {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} + {{ toYaml . }} {{- end }} +{{- end }} name: {{ template "nexus.name" . }}-psp-use rules: - apiGroups: @@ -16,4 +18,4 @@ rules: - {{ template "nexus.name" . }} verbs: - use -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/chart/templates/psp-rolebinding.yaml b/chart/templates/psp-rolebinding.yaml index 042a2ff..69040c8 100644 --- a/chart/templates/psp-rolebinding.yaml +++ b/chart/templates/psp-rolebinding.yaml @@ -3,9 +3,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: labels: {{- include "nexus.labels" . | nindent 4 }} +{{- if .Values.nexus.extraLabels }} {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} + {{ toYaml . }} {{- end }} +{{- end }} name: {{ template "nexus.name" . }}-psp-use roleRef: apiGroup: rbac.authorization.k8s.io @@ -14,4 +16,4 @@ roleRef: subjects: - kind: ServiceAccount name: {{ include "nexus.serviceAccountName" . }} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/chart/templates/psp.yaml b/chart/templates/psp.yaml index 0d7978e..c044a3f 100644 --- a/chart/templates/psp.yaml +++ b/chart/templates/psp.yaml @@ -3,9 +3,11 @@ apiVersion: policy/v1beta1 kind: PodSecurityPolicy metadata: labels: {{- include "nexus.labels" . | nindent 4 }} +{{- if .Values.nexus.extraLabels }} {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} + {{ toYaml . }} {{- end }} +{{- end }} name: {{ template "nexus.name" . }} spec: requiredDropCapabilities: diff --git a/chart/templates/pv.yaml b/chart/templates/pv.yaml index 1f17872..a7cb01c 100644 --- a/chart/templates/pv.yaml +++ b/chart/templates/pv.yaml @@ -6,11 +6,11 @@ metadata: name: {{ .Values.persistence.pdName }} labels: {{ include "nexus.labels" . | indent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} spec: capacity: storage: {{ .Values.persistence.storageSize }} diff --git a/chart/templates/pvc.yaml b/chart/templates/pvc.yaml index 32e9b78..ae8f146 100644 --- a/chart/templates/pvc.yaml +++ b/chart/templates/pvc.yaml @@ -5,11 +5,11 @@ metadata: name: {{ template "nexus.fullname" . }}-data labels: {{ include "nexus.labels" . | indent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} {{- if .Values.persistence.annotations }} annotations: {{ toYaml .Values.persistence.annotations | indent 4 }} diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml index ba7acb7..758f099 100644 --- a/chart/templates/service.yaml +++ b/chart/templates/service.yaml @@ -10,11 +10,11 @@ metadata: {{- end }} labels: {{- include "nexus.labels" . | nindent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} spec: type: {{ .Values.service.type }} ports: diff --git a/chart/templates/serviceaccount.yaml b/chart/templates/serviceaccount.yaml index 5bb8fa5..59a8b27 100644 --- a/chart/templates/serviceaccount.yaml +++ b/chart/templates/serviceaccount.yaml @@ -4,11 +4,11 @@ kind: ServiceAccount metadata: name: {{ include "nexus.serviceAccountName" . }} labels: {{- include "nexus.labels" . | nindent 4 }} - {{- if .Values.nexus.extraLabels }} - {{- with .Values.nexus.extraLabels }} - {{ toYaml . | indent 4 }} - {{- end }} +{{- if .Values.nexus.extraLabels }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} {{- end }} +{{- end }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index c1b5038..b7c6a60 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -100,6 +100,8 @@ image: pullPolicy: IfNotPresent nexus: + extraLabels: + app: nexus-repository-manager docker: enabled: false registries: [] -- GitLab From 722e0a53f5ae9ff90ef5fbebf6bb58b273a017e4 Mon Sep 17 00:00:00 2001 From: "Timothy J. Miller" Date: Tue, 20 Jul 2021 12:55:22 -0500 Subject: [PATCH 2/3] propagate extraLabels to Deployment Pod labels --- chart/templates/deployment.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 6072e44..8f3a390 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -34,6 +34,9 @@ spec: {{- end }} labels: {{- include "nexus.selectorLabels" . | nindent 8 }} + {{- with .Values.nexus.extraLabels }} + {{ toYaml . }} + {{- end }} spec: serviceAccountName: {{ include "nexus.serviceAccountName" . }} {{- if .Values.deployment.initContainers }} -- GitLab From 98d51407fb74a4f91fb544a85656dfe1184300ee Mon Sep 17 00:00:00 2001 From: Branden Cobb Date: Tue, 27 Jul 2021 14:28:26 -0600 Subject: [PATCH 3/3] chart bump changelog --- CHANGELOG.md | 6 ++++++ chart/Chart.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4d5ae8..6133f40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog --- +## [29.1.0-bb.6] - 2021-07-27 +### Fixes +- Fixed extraLabels indentation in all resources that have it. +### Added +- Added extraLabels to Deployment template labels. + ## [29.1.0-bb.5] - 2021-06-30 ### Added - Network policy to allow prometheus scraping of istio envoy sidecar diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 878cde7..e07100e 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nexus-repository-manager -version: 29.1.0-bb.5 +version: 29.1.0-bb.6 appVersion: 3.29.0 description: Sonatype Nexus Repository Manager - Universal Binary repository type: application -- GitLab