NAS-123856 / 24.04 / take size into account when creating a unique name (#1500)

This commit is contained in:
Stavros Kois
2023-09-04 19:16:03 +03:00
committed by GitHub
parent 828e6fa9ca
commit 32f5f875f7
7 changed files with 189 additions and 35 deletions

View File

@@ -2,7 +2,7 @@ apiVersion: v2
name: common
description: A library chart for iX Official Catalog
type: library
version: 1.1.0
version: 1.1.1
appVersion: v1
annotations:
title: Common Library Chart

View File

@@ -14,7 +14,8 @@ objectData: The object data to be used to render the volume.
{{- end -}}
{{- if mustHas $objectData.type (list "nfs-pv-pvc" "smb-pv-pvc") -}}
{{- $hashValues := (printf "%s-%s" $objectData.server $objectData.share) -}}
{{- $size := $objectData.size | default $rootCtx.Values.fallbackDefaults.pvcSize -}}
{{- $hashValues := (printf "%s-%s-%s" $size $objectData.server $objectData.share) -}}
{{- if $objectData.domain -}}
{{- $hashValues = (printf "%s-%s" $hashValues $objectData.domain) -}}
{{- end -}}

View File

@@ -38,7 +38,8 @@
{{/* Validate SMB CSI */}}
{{- include "ix.v1.common.lib.storage.smbCSI.validation" (dict "rootCtx" $ "objectData" $objectData) -}}
{{- $hashValues := (printf "%s-%s" $objectData.server $objectData.share) -}}
{{- $size := $objectData.size | default $.Values.fallbackDefaults.pvcSize -}}
{{- $hashValues := (printf "%s-%s-%s" $size $objectData.server $objectData.share) -}}
{{- if $objectData.domain -}}
{{- $hashValues = (printf "%s-%s" $hashValues $objectData.domain) -}}
{{- end -}}
@@ -71,7 +72,8 @@
{{/* Validate NFS CSI */}}
{{- include "ix.v1.common.lib.storage.nfsCSI.validation" (dict "rootCtx" $ "objectData" $objectData) -}}
{{- $hashValues := (printf "%s-%s" $objectData.server $objectData.share) -}}
{{- $size := $objectData.size | default $.Values.fallbackDefaults.pvcSize -}}
{{- $hashValues := (printf "%s-%s-%s" $size $objectData.server $objectData.share) -}}
{{/* Create a unique name taking into account server and share,
without this, changing one of those values is not possible */}}
{{- $hash := adler32sum $hashValues -}}