Add some extra validation on minio (#1390)

This commit is contained in:
Stavros Kois
2023-07-27 20:59:51 +03:00
committed by GitHub
parent 029a24c055
commit fbc31be962
3 changed files with 22 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ description: High Performance, Kubernetes Native Object Storage
annotations:
title: MinIO
type: application
version: 1.0.19
version: 1.0.20
apiVersion: v2
appVersion: '2023-03-24'
kubeVersion: '>=1.16.0-0'

View File

@@ -141,7 +141,7 @@ questions:
For Multi Node Multi Drive (MNMD), the entry will look like this:</br>
Example Entry - https://minio{1...3}.example.com:30000/data{1...4}</br></br>
Note that each host must use the same port number and the same number of storage items.</br>
In both cases /data{1..4} is the directories to be used for MinIO.
In both cases /data{1...4} is the directories to be used for MinIO.
You have to add additional storage for each data entry.
schema:
type: boolean

View File

@@ -39,7 +39,26 @@
{{- end -}}
{{- if and (ne (len .Values.minioStorage) 1) (not .Values.minioMultiMode) -}}
{{- fail "Expected Multi Mode to be enabled, when more than 1 storage items added" -}}
{{- fail "Expected Multi Mode to be enabled, when more than 1 storage mountPaths added" -}}
{{- end -}}
{{- range $item := .Values.minioMultiMode -}}
{{- if hasPrefix "/" $item -}}
{{- if or (contains "{" $item) (contains "}" $item) -}}
{{- if not (contains "..." $item) -}}
{{- fail "Expected Multi Mode Item to have 3 dots when its a path with expansion eg [/some_path{1...4}]" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $mountPaths := list -}}
{{- range $item := .Values.minioStorage -}}
{{- $mountPaths = mustAppend $mountPaths $item.mountPath -}}
{{- end -}}
{{- if not (deepEqual ($mountPaths) (uniq $mountPaths)) -}}
{{- fail (printf "Expected mountPaths to be unique, but got [%v]" (join ", " $mountPaths)) -}}
{{- end -}}
{{- end -}}