From 258c2f93b5790508d82c3c18c12162c7e6571ccc Mon Sep 17 00:00:00 2001 From: Guilhem Bonnefille Date: Mon, 13 Dec 2021 12:34:55 +0100 Subject: [PATCH] Use port's name (#128) --- charts/sonarqube-dce/CHANGELOG.md | 3 +++ charts/sonarqube-dce/Chart.yaml | 4 ++-- charts/sonarqube-dce/templates/sonarqube-application.yaml | 6 +++--- charts/sonarqube/CHANGELOG.md | 3 +++ charts/sonarqube/Chart.yaml | 4 ++-- charts/sonarqube/templates/deployment.yaml | 2 +- charts/sonarqube/templates/sonarqube-sts.yaml | 6 +++--- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/charts/sonarqube-dce/CHANGELOG.md b/charts/sonarqube-dce/CHANGELOG.md index ce6d86f4f..084a4703e 100644 --- a/charts/sonarqube-dce/CHANGELOG.md +++ b/charts/sonarqube-dce/CHANGELOG.md @@ -1,6 +1,9 @@ # SonarQube Chart Changelog All changes to this chart will be documented in this file. +## [0.2.2] +* replaced hardcoded port's values + ## [0.2.1] * updated SonarQube to 9.2.1 diff --git a/charts/sonarqube-dce/Chart.yaml b/charts/sonarqube-dce/Chart.yaml index 9390bf071..ccfd57e70 100644 --- a/charts/sonarqube-dce/Chart.yaml +++ b/charts/sonarqube-dce/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: sonarqube-dce description: SonarQube offers Code Quality and Code Security analysis for up to 27 languages. Find Bugs, Vulnerabilities, Security Hotspots and Code Smells throughout your workflow. -version: 0.2.1 +version: 0.2.2 appVersion: 9.2.1 keywords: - coverage @@ -22,7 +22,7 @@ annotations: url: https://community.sonarsource.com/ artifacthub.io/changes: | - kind: changed - description: "updated SonarQube to 9.2.1" + description: "replaced hardcoded port's values" artifacthub.io/containsSecurityUpdates: "false" artifacthub.io/images: | - name: sonarqube-app diff --git a/charts/sonarqube-dce/templates/sonarqube-application.yaml b/charts/sonarqube-dce/templates/sonarqube-application.yaml index 7f18bdda3..8c76c0356 100644 --- a/charts/sonarqube-dce/templates/sonarqube-application.yaml +++ b/charts/sonarqube-dce/templates/sonarqube-application.yaml @@ -226,7 +226,7 @@ spec: httpGet: scheme: HTTP path: {{ .Values.ApplicationNodes.livenessProbe.sonarWebContext }}api/system/liveness - port: 9000 + port: http httpHeaders: - name: X-Sonar-Passcode value: {{ .Values.monitoringPasscode }} @@ -242,7 +242,7 @@ spec: # A Sonarqube container is considered ready if the status is UP, DB_MIGRATION_NEEDED or DB_MIGRATION_RUNNING # status about migration are added to prevent the node to be kill while sonarqube is upgrading the database. host="$(hostname -i || echo '127.0.0.1')" - if wget -qO- http://${host}:9000{{ .Values.ApplicationNodes.readinessProbe.sonarWebContext }}api/system/status | grep -q -e '"status":"UP"' -e '"status":"DB_MIGRATION_NEEDED"' -e '"status":"DB_MIGRATION_RUNNING"'; then + if wget -qO- http://${host}:{{ .Values.service.internalPort }}{{ .Values.ApplicationNodes.readinessProbe.sonarWebContext }}api/system/status | grep -q -e '"status":"UP"' -e '"status":"DB_MIGRATION_NEEDED"' -e '"status":"DB_MIGRATION_RUNNING"'; then exit 0 fi exit 1 @@ -253,7 +253,7 @@ spec: httpGet: scheme: HTTP path: {{ .Values.ApplicationNodes.startupProbe.sonarWebContext }}api/system/status - port: 9000 + port: http initialDelaySeconds: {{ .Values.ApplicationNodes.startupProbe.initialDelaySeconds }} periodSeconds: {{ .Values.ApplicationNodes.startupProbe.periodSeconds }} failureThreshold: {{ .Values.ApplicationNodes.startupProbe.failureThreshold }} diff --git a/charts/sonarqube/CHANGELOG.md b/charts/sonarqube/CHANGELOG.md index 4c1f12735..a8cdd78da 100644 --- a/charts/sonarqube/CHANGELOG.md +++ b/charts/sonarqube/CHANGELOG.md @@ -1,6 +1,9 @@ # SonarQube Chart Changelog All changes to this chart will be documented in this file. +## [1.2.2] +* fix hardcoded reference to port 9000 + ## [1.2.1] * updated SonarQube to 9.2.1 diff --git a/charts/sonarqube/Chart.yaml b/charts/sonarqube/Chart.yaml index 0eeee2eef..fc0b90dc0 100644 --- a/charts/sonarqube/Chart.yaml +++ b/charts/sonarqube/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: sonarqube description: SonarQube offers Code Quality and Code Security analysis for up to 27 languages. Find Bugs, Vulnerabilities, Security Hotspots and Code Smells throughout your workflow. -version: 1.2.1 +version: 1.2.2 appVersion: 9.2.1 keywords: - coverage @@ -22,7 +22,7 @@ annotations: url: https://community.sonarsource.com/ artifacthub.io/changes: | - kind: changed - description: "updated SonarQube to 9.2.1" + description: "replaced hardcoded port's value" artifacthub.io/containsSecurityUpdates: "false" artifacthub.io/images: | - name: sonarqube diff --git a/charts/sonarqube/templates/deployment.yaml b/charts/sonarqube/templates/deployment.yaml index f6d085ff5..3e33b10b5 100644 --- a/charts/sonarqube/templates/deployment.yaml +++ b/charts/sonarqube/templates/deployment.yaml @@ -231,7 +231,7 @@ spec: httpGet: scheme: HTTP path: {{ .Values.livenessProbe.sonarWebContext }}api/system/liveness - port: 9000 + port: http httpHeaders: - name: X-Sonar-Passcode value: {{ .Values.monitoringPasscode }} diff --git a/charts/sonarqube/templates/sonarqube-sts.yaml b/charts/sonarqube/templates/sonarqube-sts.yaml index b42931ad9..93f847666 100644 --- a/charts/sonarqube/templates/sonarqube-sts.yaml +++ b/charts/sonarqube/templates/sonarqube-sts.yaml @@ -306,7 +306,7 @@ spec: httpGet: scheme: HTTP path: {{ .Values.livenessProbe.sonarWebContext }}api/system/liveness - port: 9000 + port: http httpHeaders: - name: X-Sonar-Passcode value: {{ .Values.monitoringPasscode }} @@ -322,7 +322,7 @@ spec: # A Sonarqube container is considered ready if the status is UP, DB_MIGRATION_NEEDED or DB_MIGRATION_RUNNING # status about migration are added to prevent the node to be kill while sonarqube is upgrading the database. host="$(hostname -i || echo '127.0.0.1')" - if wget -qO- http://${host}:9000{{ .Values.readinessProbe.sonarWebContext }}api/system/status | grep -q -e '"status":"UP"' -e '"status":"DB_MIGRATION_NEEDED"' -e '"status":"DB_MIGRATION_RUNNING"'; then + if wget -qO- http://${host}:{{ .Values.service.internalPort }}{{ .Values.readinessProbe.sonarWebContext }}api/system/status | grep -q -e '"status":"UP"' -e '"status":"DB_MIGRATION_NEEDED"' -e '"status":"DB_MIGRATION_RUNNING"'; then exit 0 fi exit 1 @@ -333,7 +333,7 @@ spec: httpGet: scheme: HTTP path: {{ .Values.readinessProbe.sonarWebContext }}api/system/status - port: 9000 + port: http initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }} periodSeconds: {{ .Values.startupProbe.periodSeconds }} failureThreshold: {{ .Values.startupProbe.failureThreshold }}