fix(kubernetes): use hasKey for ephemeralStorage migration guard

Signed-off-by: Arsolitt <arsolitt@gmail.com>
This commit is contained in:
Arsolitt 2026-04-23 18:06:54 +03:00
parent a1046b5ef0
commit c5b3a93d52
No known key found for this signature in database
GPG key ID: 4D8302CE6A9247C4
2 changed files with 11 additions and 1 deletions

View file

@ -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:

View file

@ -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.'