From 18df5bdaa7f8720150f7143d04d440e7f34d9e0a Mon Sep 17 00:00:00 2001 From: Matteo Palladino Date: Thu, 2 Apr 2020 11:43:06 +0200 Subject: [PATCH] [sonarqube] Update Deployment specs to apps/v1 --- .../charts/mysql/templates/deployment.yaml | 5 ++- .../postgresql/templates/deployment.yaml | 5 ++- .../templates/tests/sonarqube-test.yaml | 42 ------------------- .../templates/tests/test-config.yaml | 14 ------- 4 files changed, 8 insertions(+), 58 deletions(-) delete mode 100644 charts/sonarqube/templates/tests/sonarqube-test.yaml delete mode 100644 charts/sonarqube/templates/tests/test-config.yaml diff --git a/charts/sonarqube/charts/mysql/templates/deployment.yaml b/charts/sonarqube/charts/mysql/templates/deployment.yaml index c6e7e691..78dd7060 100644 --- a/charts/sonarqube/charts/mysql/templates/deployment.yaml +++ b/charts/sonarqube/charts/mysql/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "mysql.fullname" . }} @@ -8,6 +8,9 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: + selector: + matchLabels: + app: {{ template "mysql.fullname" . }} template: metadata: labels: diff --git a/charts/sonarqube/charts/postgresql/templates/deployment.yaml b/charts/sonarqube/charts/postgresql/templates/deployment.yaml index b3e0e303..5137fb5a 100644 --- a/charts/sonarqube/charts/postgresql/templates/deployment.yaml +++ b/charts/sonarqube/charts/postgresql/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "postgresql.fullname" . }} @@ -8,6 +8,9 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: + selector: + matchLabels: + app: {{ template "postgresql.fullname" . }} template: metadata: labels: diff --git a/charts/sonarqube/templates/tests/sonarqube-test.yaml b/charts/sonarqube/templates/tests/sonarqube-test.yaml deleted file mode 100644 index 35e110bd..00000000 --- a/charts/sonarqube/templates/tests/sonarqube-test.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ .Release.Name }}-ui-test" - annotations: - "helm.sh/hook": test-success - labels: - app: {{ template "sonarqube.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - initContainers: - - name: "test-framework" - image: "dduportal/bats:0.4.0" - command: - - "bash" - - "-c" - - | - set -ex - # copy bats to tools dir - cp -R /usr/local/libexec/ /tools/bats/ - volumeMounts: - - mountPath: /tools - name: tools - containers: - - name: {{ .Release.Name }}-ui-test - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} - command: ["/tools/bats/bats", "-t", "/tests/run.sh"] - volumeMounts: - - mountPath: /tests - name: tests - readOnly: true - - mountPath: /tools - name: tools - volumes: - - name: tests - configMap: - name: {{ template "sonarqube.fullname" . }}-tests - - name: tools - emptyDir: {} - restartPolicy: Never diff --git a/charts/sonarqube/templates/tests/test-config.yaml b/charts/sonarqube/templates/tests/test-config.yaml deleted file mode 100644 index 73d41291..00000000 --- a/charts/sonarqube/templates/tests/test-config.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "sonarqube.fullname" . }}-tests - labels: - app: {{ template "sonarqube.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - run.sh: |- - @test "Testing Sonarqube UI is accessible" { - curl --connect-timeout 5 --retry 12 --retry-delay 1 --retry-max-time 60 {{ .Release.Name }}-sonarqube:{{ .Values.service.internalPort }}/sessions/new - }