Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion images/virtualization-artifact/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ require (
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
)

replace github.com/deckhouse/virtualization/api => ./../../api
replace (
github.com/deckhouse/virtualization/api => ./../../api
kubevirt.io/api => github.com/deckhouse/3p-kubevirt-api v1.3.1-v12n.0
)

replace (
k8s.io/api => k8s.io/api v0.33.3
Expand Down
2 changes: 2 additions & 0 deletions images/virtualization-artifact/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deckhouse/3p-kubevirt-api v1.3.1-v12n.0 h1:Tygrxudb159/H4ozBY+jvVhNWWGP6GYNYz8Hg8k2Sok=
github.com/deckhouse/3p-kubevirt-api v1.3.1-v12n.0/go.mod h1:tCn7VAZktEvymk490iPSMPCmKM9UjbbfH2OsFR/IOLU=
github.com/deckhouse/deckhouse/pkg/log v0.0.0-20250226105106-176cd3afcdd5 h1:PsN1E0oxC/+4zdA977txrqUCuObFL3HAuu5Xnud8m8c=
github.com/deckhouse/deckhouse/pkg/log v0.0.0-20250226105106-176cd3afcdd5/go.mod h1:Mk5HRzkc5pIcDIZ2JJ6DPuuqnwhXVkb3you8M8Mg+4w=
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ func (b *KVVM) SetDisk(name string, opts SetDiskOptions) error {

case opts.ContainerDisk != nil:
vs.ContainerDisk = &virtv1.ContainerDiskSource{
Image: *opts.ContainerDisk,
Image: *opts.ContainerDisk,
Hotpluggable: opts.IsHotplugged,
}

case opts.Provisioning != nil:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type HotPlugDeviceSettings struct {
VolumeName string
PVCName string
DataVolumeName string
ImageName string
}

func ApplyVirtualMachineSpec(
Expand Down Expand Up @@ -130,11 +131,10 @@ func ApplyVirtualMachineSpec(
PVCName: volume.PersistentVolumeClaim.ClaimName,
})
}
// FIXME(VM): not used, now only supports PVC
if volume.DataVolume != nil && volume.DataVolume.Hotpluggable {
if volume.ContainerDisk != nil && volume.ContainerDisk.Hotpluggable {
hotpluggedDevices = append(hotpluggedDevices, HotPlugDeviceSettings{
VolumeName: volume.Name,
DataVolumeName: volume.DataVolume.Name,
VolumeName: volume.Name,
ImageName: volume.ContainerDisk.Image,
})
}
}
Expand Down Expand Up @@ -227,8 +227,13 @@ func ApplyVirtualMachineSpec(
}); err != nil {
return err
}
// FIXME(VM): not used, now only supports PVC
case device.DataVolumeName != "":
case device.ImageName != "":
if err := kvvm.SetDisk(device.VolumeName, SetDiskOptions{
ContainerDisk: pointer.GetPointer(device.ImageName),
IsHotplugged: true,
}); err != nil {
return err
}
}
}
if err := kvvm.SetProvisioning(vm.Spec.Provisioning); err != nil {
Expand Down
Loading