Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for hotplug with WFFC and CDI populators + test fixes #9918

Merged
merged 2 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/virt-controller/watch/vmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ func (c *VMIController) createAttachmentPodTemplate(vmi *virtv1.VirtualMachineIn
}
for volumeName, pvc := range volumeNamesPVCMap {
//Verify the PVC is ready to be used.
populated, err := cdiv1.IsPopulated(pvc, func(name, namespace string) (*cdiv1.DataVolume, error) {
populated, err := cdiv1.IsSucceededOrPendingPopulation(pvc, func(name, namespace string) (*cdiv1.DataVolume, error) {
dv, exists, _ := c.dataVolumeInformer.GetStore().GetByKey(fmt.Sprintf("%s/%s", namespace, name))
if !exists {
return nil, fmt.Errorf("unable to find datavolume %s/%s", namespace, name)
Expand Down
4 changes: 2 additions & 2 deletions tests/storage/datavolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ var _ = SIGDescribe("DataVolume Integration", func() {

// This will only work on storage with binding mode WaitForFirstConsumer,
if libstorage.IsStorageClassBindingModeWaitForFirstConsumer(libstorage.Config.StorageRWOFileSystem) {
Eventually(ThisDV(dataVolume), 40).Should(BeInPhase(cdiv1.WaitForFirstConsumer))
Eventually(ThisDV(dataVolume), 40).Should(Or(BeInPhase(cdiv1.WaitForFirstConsumer), BeInPhase(cdiv1.PendingPopulation)))
}
num := 2
By("Starting and stopping the VirtualMachineInstance a number of times")
Expand Down Expand Up @@ -324,7 +324,7 @@ var _ = SIGDescribe("DataVolume Integration", func() {
Expect(err).ToNot(HaveOccurred())
// This will only work on storage with binding mode WaitForFirstConsumer,
if libstorage.IsStorageClassBindingModeWaitForFirstConsumer(libstorage.Config.StorageRWOFileSystem) {
Eventually(ThisDV(dataVolume), 40).Should(BeInPhase(cdiv1.WaitForFirstConsumer))
Eventually(ThisDV(dataVolume), 40).Should(Or(BeInPhase(cdiv1.WaitForFirstConsumer), BeInPhase(cdiv1.PendingPopulation)))
}
// with WFFC the run actually starts the import and then runs VM, so the timeout has to include both
// import and start
Expand Down
2 changes: 1 addition & 1 deletion tests/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ var _ = SIGDescribe("Storage", func() {
Expect(err).ToNot(HaveOccurred())
By("Waiting until the DataVolume is ready")
if libstorage.IsStorageClassBindingModeWaitForFirstConsumer(libstorage.Config.StorageRWOFileSystem) {
Eventually(ThisDV(dataVolume), 30).Should(BeInPhase(cdiv1.WaitForFirstConsumer))
Eventually(ThisDV(dataVolume), 30).Should(Or(BeInPhase(cdiv1.WaitForFirstConsumer), BeInPhase(cdiv1.PendingPopulation)))
}

virtiofsMountPath := fmt.Sprintf("/mnt/virtiofs_%s", dataVolume.Name)
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func NewRandomVirtualMachineInstanceWithDisk(imageUrl, namespace, sc string, acc
var err error
dv, err = virtCli.CdiClient().CdiV1beta1().DataVolumes(namespace).Create(context.Background(), dv, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
libstorage.EventuallyDV(dv, 240, Or(HaveSucceeded(), BeInPhase(cdiv1.WaitForFirstConsumer)))
libstorage.EventuallyDV(dv, 240, Or(HaveSucceeded(), BeInPhase(cdiv1.WaitForFirstConsumer), BeInPhase(cdiv1.PendingPopulation)))
return NewRandomVMIWithDataVolume(dv.Name), dv
}

Expand Down
2 changes: 1 addition & 1 deletion tests/virtiofs/datavolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ var _ = Describe("[sig-storage] virtiofs", decorators.SigStorage, func() {
Expect(err).ToNot(HaveOccurred())
By("Waiting until the DataVolume is ready")
if libstorage.IsStorageClassBindingModeWaitForFirstConsumer(libstorage.Config.StorageRWOFileSystem) {
Eventually(ThisDV(dataVolume), 30).Should(BeInPhase(cdiv1.WaitForFirstConsumer))
Eventually(ThisDV(dataVolume), 30).Should(Or(BeInPhase(cdiv1.WaitForFirstConsumer), BeInPhase(cdiv1.PendingPopulation)))
}

virtiofsMountPath := fmt.Sprintf("/mnt/virtiofs_%s", dataVolume.Name)
Expand Down