From 2e8d10cdb1a68a738834d42a30c0a70a29f99b6f Mon Sep 17 00:00:00 2001 From: "Timothy J. Miller" Date: Wed, 28 Jul 2021 15:07:18 +0000 Subject: [PATCH] Fix extralabels indentation and add to Deployment pod template --- CHANGELOG.md | 6 ++++++ chart/Chart.yaml | 2 +- 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 | 11 +++++++---- 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 ++ 18 files changed, 84 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e6afe7..8bb163e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog --- +## [29.1.0-bb.7] - 2021-07-27 +### Fixes +- Fixed extraLabels indentation in all resources that have it. +### Added +- Added extraLabels to Deployment template labels. + ## [29.1.0-bb.6] - 2021-06-30 ### Added - Add openshift toggle, conditionally add port 5353 egress. Changing "openshift:" to true in values.yaml will enable. diff --git a/chart/Chart.yaml b/chart/Chart.yaml index e07100e..bc634c5 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nexus-repository-manager -version: 29.1.0-bb.6 +version: 29.1.0-bb.7 appVersion: 3.29.0 description: Sonatype Nexus Repository Manager - Universal Binary repository type: application 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..8f3a390 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 }} @@ -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 }} 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 84fc2d3..fe0644b 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