Skip to content

Commit b58ebd7

Browse files
check containerDisk
Signed-off-by: Yaroslav Borbat <[email protected]>
1 parent c6003e7 commit b58ebd7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

images/virtualization-artifact/pkg/controller/service/attachment_service.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ func (s AttachmentService) CanHotPlug(ad *AttachmentDisk, vm *v1alpha2.VirtualMa
104104
if kvvm.Spec.Template != nil {
105105
for _, vs := range kvvm.Spec.Template.Spec.Volumes {
106106
if vs.Name == name {
107-
if vs.PersistentVolumeClaim == nil {
108-
return false, fmt.Errorf("kvvm %s/%s spec volume %s does not have a pvc reference", kvvm.Namespace, kvvm.Name, vs.Name)
107+
if vs.PersistentVolumeClaim == nil && vs.ContainerDisk == nil {
108+
return false, fmt.Errorf("kvvm %s/%s spec volume %s does not have a pvc or container disk reference", kvvm.Namespace, kvvm.Name, vs.Name)
109109
}
110110

111-
if !vs.PersistentVolumeClaim.Hotpluggable {
111+
if !vs.PersistentVolumeClaim.Hotpluggable && !vs.ContainerDisk.Hotpluggable {
112112
return false, fmt.Errorf("%w: virtual machine has a block device reference, but it is not a hot-plugged volume", ErrBlockDeviceIsSpecAttached)
113113
}
114114

0 commit comments

Comments
 (0)