Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #219 from namloc2001/openshift
Browse files Browse the repository at this point in the history
postgres condition applied to wait-for-db initContainer
  • Loading branch information
rjkernick authored Nov 21, 2020
2 parents 3cf9ffe + 4be14dc commit 34cdade
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions charts/sonarqube/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# SonarQube Chart Changelog
All changes to this chart will be documented in this file.

## [9.2.2]
* Added a condition to deployment.yaml so that `wait-for-db` initContainer is only created if `postgresql.enabled=true`

## [9.2.1]
* Updated the configuration table to include the additional keys added in release 9.2.0.

Expand Down
2 changes: 1 addition & 1 deletion charts/sonarqube/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: sonarqube
description: SonarQube is an open sourced code quality scanning tool
version: 9.2.1
version: 9.2.2
appVersion: 8.5.1-community
keywords:
- coverage
Expand Down
4 changes: 3 additions & 1 deletion charts/sonarqube/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,14 @@ spec:
{{- . | toYaml | trim | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.postgresql.enabled }}
- name: "wait-for-db"
image: {{ default "busybox:1.32" .Values.initContainers.image }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{ toYaml .Values.initContainers.resources | indent 12 }}
command: ["/bin/sh", "-c", "for i in $(seq 1 200); do nc -z -w3 {{ .Release.Name}}-postgresql 5432 && exit 0 || sleep 2; done; exit 1"]
command: ["/bin/sh", "-c", "for i in $(seq 1 200); do nc -z -w3 {{ .Release.Name}}-postgresql 5432 && exit 0 || sleep 2; done; exit 1"]
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
Expand Down

0 comments on commit 34cdade

Please sign in to comment.