From 6f1daa7981b9839bbb105fe0691040302c328e51 Mon Sep 17 00:00:00 2001 From: Michael Sauter Date: Tue, 31 Oct 2023 11:03:48 +0100 Subject: [PATCH] Mark important values as required --- Makefile | 5 +++-- deploy/chart/templates/configmap-bitbucket.yaml | 4 ++-- deploy/chart/templates/configmap-cluster.yaml | 2 +- deploy/chart/templates/configmap-nexus.yaml | 2 +- deploy/chart/templates/deployment.yaml | 4 ++-- deploy/chart/values.yaml | 10 +++++----- deploy/values.yaml.tmpl | 8 ++++---- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index ca15e3b4..ca5e4a27 100644 --- a/Makefile +++ b/Makefile @@ -36,9 +36,10 @@ lint-shell: ## Run shellcheck. shellcheck scripts/*.sh build/images/scripts/* deploy/*.sh .PHONY: lint-shell +set_values = nexusUrl=http://example.com,bitbucketUrl=http://example.com,consoleUrl=http://example.com,pipelineManager.storageClassName=standard docs: ## Render documentation for tasks. renderedStartTask=$(shell mktemp); \ - helm template ods-pipeline deploy/chart --show-only=templates/task-start.yaml > $$renderedStartTask; \ + helm template ods-pipeline deploy/chart --show-only=templates/task-start.yaml --set $(set_values) > $$renderedStartTask; \ go run github.com/opendevstack/ods-pipeline/cmd/taskdoc \ -task $$renderedStartTask \ -description build/docs/task-start.adoc \ @@ -46,7 +47,7 @@ docs: ## Render documentation for tasks. rm $$renderedStartTask renderedFinishTask=$(shell mktemp); \ - helm template ods-pipeline deploy/chart --show-only=templates/task-finish.yaml > $$renderedFinishTask; \ + helm template ods-pipeline deploy/chart --show-only=templates/task-finish.yaml --set $(set_values) > $$renderedFinishTask; \ go run github.com/opendevstack/ods-pipeline/cmd/taskdoc \ -task $$renderedFinishTask \ -description build/docs/task-finish.adoc \ diff --git a/deploy/chart/templates/configmap-bitbucket.yaml b/deploy/chart/templates/configmap-bitbucket.yaml index 5aa46490..891676f5 100644 --- a/deploy/chart/templates/configmap-bitbucket.yaml +++ b/deploy/chart/templates/configmap-bitbucket.yaml @@ -5,5 +5,5 @@ metadata: labels: {{- include "chart.labels" . | nindent 4}} data: - url: '{{.Values.bitbucketUrl | trimSuffix "/"}}' - repoBase: '{{.Values.bitbucketUrl | trimSuffix "/"}}/scm' + url: '{{required "bitbucketUrl is required" .Values.bitbucketUrl | trimSuffix "/"}}' + repoBase: '{{required "bitbucketUrl is required" .Values.bitbucketUrl | trimSuffix "/"}}/scm' diff --git a/deploy/chart/templates/configmap-cluster.yaml b/deploy/chart/templates/configmap-cluster.yaml index 8c17e842..8c53edd4 100644 --- a/deploy/chart/templates/configmap-cluster.yaml +++ b/deploy/chart/templates/configmap-cluster.yaml @@ -5,4 +5,4 @@ metadata: labels: {{- include "chart.labels" . | nindent 4}} data: - consoleUrl: '{{.Values.consoleUrl | trimSuffix "/"}}' + consoleUrl: '{{required "consoleUrl is required" .Values.consoleUrl | trimSuffix "/"}}' diff --git a/deploy/chart/templates/configmap-nexus.yaml b/deploy/chart/templates/configmap-nexus.yaml index 837eb371..ea12aa84 100644 --- a/deploy/chart/templates/configmap-nexus.yaml +++ b/deploy/chart/templates/configmap-nexus.yaml @@ -5,4 +5,4 @@ metadata: labels: {{- include "chart.labels" . | nindent 4}} data: - url: '{{.Values.nexusUrl | trimSuffix "/"}}' + url: '{{required "nexusUrl is required" .Values.nexusUrl | trimSuffix "/"}}' diff --git a/deploy/chart/templates/deployment.yaml b/deploy/chart/templates/deployment.yaml index 482126c0..775501b7 100644 --- a/deploy/chart/templates/deployment.yaml +++ b/deploy/chart/templates/deployment.yaml @@ -46,9 +46,9 @@ spec: - name: ODS_STORAGE_PROVISIONER value: '{{.Values.pipelineManager.storageProvisioner}}' - name: ODS_STORAGE_CLASS_NAME - value: '{{.Values.pipelineManager.storageClassName}}' + value: '{{required "pipelineManager.storageClassName is required" .Values.pipelineManager.storageClassName}}' - name: ODS_STORAGE_SIZE - value: '{{.Values.pipelineManager.storageSize}}' + value: '{{required "pipelineManager.storageSize is required" .Values.pipelineManager.storageSize}}' - name: ODS_PRUNE_MIN_KEEP_HOURS value: '{{int .Values.pipelineRunMinKeepHours}}' - name: ODS_PRUNE_MAX_KEEP_RUNS diff --git a/deploy/chart/values.yaml b/deploy/chart/values.yaml index 33abac1c..f74ec118 100644 --- a/deploy/chart/values.yaml +++ b/deploy/chart/values.yaml @@ -29,7 +29,7 @@ nexusUsername: '' # Cluster # URL (including scheme, without trailing slash) of the OpenShift Web Console. -consoleUrl: 'http://example.com' +consoleUrl: '' # Notification Webhook notification: @@ -92,10 +92,10 @@ pipelineRunMaxKeepRuns: '20' # Pipeline Manager pipelineManager: # PVC (used for the pipeline workspace) - # Storage provisioner. On AWS backed clusters, use 'kubernetes.io/aws-ebs'. - storageProvisioner: 'kubernetes.io/aws-ebs' - # Storage class. On AWS backed clusters, use 'gp2'. - storageClassName: 'gp2' + # Storage provisioner. + storageProvisioner: '' + # Storage class. + storageClassName: '' # Storage size. Defaults to 2Gi unless set explicitly here. storageSize: '5Gi' # Number of replicas to run for the pipeline manager. diff --git a/deploy/values.yaml.tmpl b/deploy/values.yaml.tmpl index a85ee168..305cb371 100644 --- a/deploy/values.yaml.tmpl +++ b/deploy/values.yaml.tmpl @@ -21,7 +21,7 @@ consoleUrl: '' # Pipeline Manager pipelineManager: # PVC (used for the pipeline workspace) - # Storage provisioner. On AWS backed clusters, use 'kubernetes.io/aws-ebs'. - storageProvisioner: 'kubernetes.io/aws-ebs' - # Storage class. On AWS backed clusters, use 'gp2'. - storageClassName: 'gp2' + # Storage provisioner. On AWS backed clusters, use e.g. 'ebs.csi.aws.com'. + storageProvisioner: '' + # Storage class. On AWS backed clusters, use e.g. 'gp3-csi'. + storageClassName: ''