Fix vm-disk lookup (#582)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Updated DataVolume lookup mechanism to correctly match disk names by
prepending "vm-disk-" prefix in Virtual Machine configuration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Andrei Kvapil
2025-01-16 11:40:32 +01:00
committed by GitHub
parent dd4fcd5539
commit 9c8652cd5b

View File

@@ -47,7 +47,7 @@ spec:
disks:
{{- range $i, $disk := .Values.disks }}
- name: disk-{{ .name }}
{{- $disk := lookup "cdi.kubevirt.io/v1beta1" "DataVolume" $.Release.Namespace .name }}
{{- $disk := lookup "cdi.kubevirt.io/v1beta1" "DataVolume" $.Release.Namespace (printf "vm-disk-%s" .name) }}
{{- if $disk }}
{{- if and (hasKey $disk.metadata.annotations "vm-disk.cozystack.io/optical") (eq (index $disk.metadata.annotations "vm-disk.cozystack.io/optical") "true") }}
cdrom: {}