-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves validations from schema to validations.yaml
- Loading branch information
Showing
4 changed files
with
25 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
{{/* | ||
This file is for validating the values.yaml file. | ||
It is used to validate the values.yaml file before the installation starts. | ||
*/}} | ||
{{- define "sonarqube.fail" -}} | ||
{{- printf "\n ** The values.yaml file is not valid. ** \n %s\n" . | fail -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
* Validates the monitoring passcode logic. | ||
*/}} | ||
{{- if or (and (not .Values.monitoringPasscode) (not .Values.monitoringPasscodeSecretName) (not .Values.monitoringPasscodeSecretKey)) (and (not .Values.monitoringPasscodeSecretName) .Values.monitoringPasscodeSecretKey) (and .Values.monitoringPasscodeSecretName (not .Values.monitoringPasscodeSecretKey)) -}} | ||
{{- fail "\n ** The values.yaml file is not valid. ** \n Please provide a passcode either setting \"monitoringPasscode\" or \"monitoringPasscodeSecretName\" and \"monitoringPasscodeSecretKey\"" -}} | ||
{{- include "sonarqube.fail" "Please provide a passcode either setting \"monitoringPasscode\" or \"monitoringPasscodeSecretName\" and \"monitoringPasscodeSecretKey\"" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
* Validates the community.enabled, edition, and tag logic. | ||
*/}} | ||
{{- if and (.Values.community.enabled) (not (empty .Values.edition)) -}} | ||
{{- include "sonarqube.fail" "You can't set 'community.enabled=true' and an 'edition' at the same time." -}} | ||
{{- else if and (not .Values.community.enabled) (empty .Values.edition) -}} | ||
{{- include "sonarqube.fail" "You must choose an 'edition' to install: 'developer' or 'enterprise'." -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters