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
Allow LUN disks to be hotplugged #10529
Conversation
Skipping CI for Draft Pull Request. |
/test pull-kubevirt-e2e-k8s-1.28-sig-storage |
/cc |
93f9d6e
to
94d1e87
Compare
/test pull-kubevirt-e2e-k8s-1.28-sig-storage |
94d1e87
to
b6500d9
Compare
/test pull-kubevirt-e2e-k8s-1.28-sig-storage |
/test pull-kubevirt-e2e-k8s-1.27-sig-storage |
b6500d9
to
e806320
Compare
Signed-off-by: Alvaro Romero <alromero@redhat.com>
e806320
to
fbbf3f9
Compare
Signed-off-by: Alvaro Romero <alromero@redhat.com>
a55e5f5
to
a460a29
Compare
Hey @alicefr, I'm waiting to see how tests behave but this should be ready for review. Thanks! |
/test pull-kubevirt-e2e-k8s-1.28-sig-storage |
pkg/virt-api/webhooks/validating-webhook/admitters/vmi-update-admitter_test.go
Show resolved
Hide resolved
) | ||
|
||
var ( | ||
serial string | ||
cache string | ||
serial string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you avoid global vars? (possibly in a follow up)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All virtctl commands use (and require) global variables to store flags, I think we should follow that standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not true and IMO using global variables is not a very good standard.
e.g. virtctl create {vm|instancetype|preference}
do neither use nor require them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aw, you are right, I checked our other commands and assumed they were all the same 🤦 Anyway this command uses some common global variables that would require a considerable refactor in all vm commands, so I prefer to leave that for another PR.
|
||
vm, err = virtClient.VirtualMachine(testsuite.GetTestNamespace(vmi)).Create(context.Background(), tests.NewRandomVirtualMachine(vmi, true)) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Eventually(func() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could make beReady()
from vm_test.go
public and use it here to:
Eventually(ThisVM(vm), 300*time.Second, 1*time.Second).Should(Not(beReady()))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer to leave that for a possible follow-up, there are several instances of this code block between all tests and for consistency I think it'd be better to take out all the beCreated, beReady, beRestarted, etc. functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, do you want to create an issue for the follow-ups?
/retest-required |
7b0c064
to
79d6f76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
/lgtm
|
||
vm, err = virtClient.VirtualMachine(testsuite.GetTestNamespace(vmi)).Create(context.Background(), tests.NewRandomVirtualMachine(vmi, true)) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Eventually(func() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, do you want to create an issue for the follow-ups?
pkg/virtctl/vm/add_volume.go
Outdated
}, | ||
VolumeSource: volumeSource, | ||
DryRun: *dryRunOption, | ||
} | ||
if diskType == "" || diskType == "disk" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: you could replace this with a switch case
nodeName = tests.NodeNameWithHandler() | ||
address, device = tests.CreateSCSIDisk(nodeName, []string{}) | ||
By(fmt.Sprintf("Create PVC with SCSI disk %s", device)) | ||
pv, pvc, err = tests.CreatePVandPVCwithSCSIDisk(nodeName, device, util.NamespaceTestDefault, "scsi-disks", "scsipv", "scsipvc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the namespaces always match for util.NamespaceTestDefault
and the testsuite.GetTestNamespace
? Could happen that you create the PVC and the VM in 2 different namespaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it shouldn't be a problem but will only use the former for consistency.
removeVolumeVM(vm.Name, vm.Namespace, testNewVolume1, false) | ||
removeVolumeVM(vm.Name, vm.Namespace, testNewVolume2, false) | ||
|
||
verifyVolumeAndDiskVMRemoved(vm, testNewVolume1, testNewVolume2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this into the AfterEach
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having a different number of volumes between tests overcomplicates this a little bit and would look less nice, prefer to leave it like this.
I left a couple of questions but the code looks good! |
Signed-off-by: Alvaro Romero <alromero@redhat.com>
79d6f76
to
e5f5c78
Compare
@alromeros thanks for the work, looks good! /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alicefr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-kubevirt-e2e-k8s-1.26-sig-storage |
1 similar comment
/test pull-kubevirt-e2e-k8s-1.26-sig-storage |
/cherrypick release-1.1 |
@alromeros: new pull request created: #10909 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What this PR does / why we need it:
This PR aims to allow LUN disks to be hotplugged, instead of simply allowing regular Disk types.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes # https://bugzilla.redhat.com/show_bug.cgi?id=2211266
Special notes for your reviewer:
Release note: