fix(kubernetes): use hasKey for ephemeralStorage migration guard
Signed-off-by: Arsolitt <arsolitt@gmail.com>
This commit is contained in:
parent
a1046b5ef0
commit
c5b3a93d52
2 changed files with 11 additions and 1 deletions
|
|
@ -27,7 +27,7 @@ spec:
|
|||
{{/* Populator creates intermediate PVC + PV rebind that causes ClaimMisbound with LINSTOR CSI */}}
|
||||
cdi.kubevirt.io/storage.usePopulator: "false"
|
||||
spec:
|
||||
{{- if .group.ephemeralStorage }}
|
||||
{{- if hasKey .group "ephemeralStorage" }}
|
||||
{{- fail (printf "nodeGroup %q: ephemeralStorage is no longer supported. Rename it to diskSize. See README.md for migration instructions." .groupName) }}
|
||||
{{- end }}
|
||||
source:
|
||||
|
|
|
|||
|
|
@ -352,3 +352,13 @@ tests:
|
|||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: 'nodeGroup "md0": ephemeralStorage is no longer supported. Rename it to diskSize. See README.md for migration instructions.'
|
||||
|
||||
- it: fails when ephemeralStorage is set to empty string
|
||||
release:
|
||||
name: test-k8s
|
||||
namespace: tenant-test
|
||||
set:
|
||||
nodeGroups.md0.ephemeralStorage: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: 'nodeGroup "md0": ephemeralStorage is no longer supported. Rename it to diskSize. See README.md for migration instructions.'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue