From 132b877c6d3c685da2e2126be9842db4ec64bd65 Mon Sep 17 00:00:00 2001 From: yaroslavborbat Date: Thu, 16 Jan 2025 23:25:04 +0300 Subject: [PATCH] fix Signed-off-by: yaroslavborbat --- .../patches/032-hotplug-container-disk.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/images/virt-artifact/patches/032-hotplug-container-disk.patch b/images/virt-artifact/patches/032-hotplug-container-disk.patch index db86e5ca3c..dc2a28e8b0 100644 --- a/images/virt-artifact/patches/032-hotplug-container-disk.patch +++ b/images/virt-artifact/patches/032-hotplug-container-disk.patch @@ -300,6 +300,20 @@ index 490cc445ef..4b7dbc12fe 100644 hotplugVolumes = append(hotplugVolumes, vmiVolume.DeepCopy()) } } +diff --git a/pkg/storage/types/pvc.go b/pkg/storage/types/pvc.go +index c8f387db16..23f11f2cad 100644 +--- a/pkg/storage/types/pvc.go ++++ b/pkg/storage/types/pvc.go +@@ -144,6 +144,9 @@ func GetPVCsFromVolumes(volumes []virtv1.Volume) map[string]string { + func VirtVolumesToPVCMap(volumes []*virtv1.Volume, pvcStore cache.Store, namespace string) (map[string]*k8sv1.PersistentVolumeClaim, error) { + volumeNamesPVCMap := make(map[string]*k8sv1.PersistentVolumeClaim) + for _, volume := range volumes { ++ if volume.ContainerDisk != nil { ++ continue ++ } + claimName := PVCNameFromVirtVolume(volume) + if claimName == "" { + return nil, fmt.Errorf("volume %s is not a PVC or Datavolume", volume.Name) diff --git a/pkg/virt-api/rest/subresource.go b/pkg/virt-api/rest/subresource.go index b5d62f5af5..6a3e2b4143 100644 --- a/pkg/virt-api/rest/subresource.go