Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: yaroslavborbat <[email protected]>
  • Loading branch information
yaroslavborbat committed Jan 15, 2025
1 parent 948a6d0 commit b1115fa
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions images/virt-artifact/patches/032-hotplug-container-disk.patch
Original file line number Diff line number Diff line change
Expand Up @@ -301,20 +301,28 @@ index 490cc445ef..4b7dbc12fe 100644
}
}
diff --git a/pkg/virt-api/rest/subresource.go b/pkg/virt-api/rest/subresource.go
index b5d62f5af5..bf561f00ae 100644
index b5d62f5af5..1df640888f 100644
--- a/pkg/virt-api/rest/subresource.go
+++ b/pkg/virt-api/rest/subresource.go
@@ -1023,7 +1023,8 @@ func volumeSourceName(volumeSource *v1.HotplugVolumeSource) string {
@@ -1018,12 +1018,16 @@ func volumeSourceName(volumeSource *v1.HotplugVolumeSource) string {
if volumeSource.PersistentVolumeClaim != nil {
return volumeSource.PersistentVolumeClaim.ClaimName
}
+ if volumeSource.ContainerDisk != nil {
+ return volumeSource.ContainerDisk.Image
+ }
return ""
}

func volumeSourceExists(volume v1.Volume, volumeName string) bool {
return (volume.DataVolume != nil && volume.DataVolume.Name == volumeName) ||
- (volume.PersistentVolumeClaim != nil && volume.PersistentVolumeClaim.ClaimName == volumeName)
+ (volume.PersistentVolumeClaim != nil && volume.PersistentVolumeClaim.ClaimName == volumeName) ||
+ (volume.ContainerDisk != nil && volume.ContainerDisk.Image != "")
+ (volume.ContainerDisk != nil && volume.ContainerDisk.Image == volumeName)
}

func volumeExists(volume v1.Volume, volumeName string) bool {
@@ -1125,6 +1126,8 @@ func (app *SubresourceAPIApp) addVolumeRequestHandler(request *restful.Request,
@@ -1125,6 +1129,8 @@ func (app *SubresourceAPIApp) addVolumeRequestHandler(request *restful.Request,
opts.VolumeSource.DataVolume.Hotpluggable = true
} else if opts.VolumeSource.PersistentVolumeClaim != nil {
opts.VolumeSource.PersistentVolumeClaim.Hotpluggable = true
Expand Down

0 comments on commit b1115fa

Please sign in to comment.