-
Notifications
You must be signed in to change notification settings - Fork 1.5k
cleanup(virtctl): Remove dryRun options #9608
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
Conversation
This commit removes dryRun options and adds functionality to CleanNamespaces to remove VirtualMachinePreference and VirtualMachineClusterPreference instead. Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
/retest |
This commit updates help message for virtctl create preference command. Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
Looks good to me, is this needed for Instancetypes too? |
It is already done for Instancetypes. |
/retest |
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.
/lgtm
@@ -36,13 +38,16 @@ var _ = Describe("[sig-compute] create preference", decorators.SigCompute, func( | |||
case *instancetypev1alpha2.VirtualMachinePreference: | |||
ExpectWithOffset(1, namespaced).To(BeTrue(), "expected VirtualMachinePreference to be created") | |||
ExpectWithOffset(1, obj.Kind).To(Equal("VirtualMachinePreference")) | |||
preference, err := virtClient.VirtualMachinePreference(util.NamespaceTestDefault).Create(context.Background(), (*instancetypev1alpha2.VirtualMachinePreference)(obj), metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}) | |||
preference, err := virtClient.VirtualMachinePreference(util.NamespaceTestDefault).Create(context.Background(), (*instancetypev1alpha2.VirtualMachinePreference)(obj), metav1.CreateOptions{}) |
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 - I don't think you need to cast obj here.
ExpectWithOffset(1, err).ToNot(HaveOccurred()) | ||
return &preference.Spec, nil | ||
case *instancetypev1alpha2.VirtualMachineClusterPreference: | ||
ExpectWithOffset(1, namespaced).To(BeFalse(), "expected VirtualMachineClusterPreference to be created") | ||
ExpectWithOffset(1, obj.Kind).To(Equal("VirtualMachineClusterPreference")) | ||
clusterPreference, err := virtClient.VirtualMachineClusterPreference().Create(context.Background(), (*instancetypev1alpha2.VirtualMachineClusterPreference)(obj), metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}) | ||
obj.Labels = map[string]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.
FWIW I bet this isn't happening for cluster instance types and preferences in other functional tests, something to look into outside of this PR.
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.
+1 Can we have a quick look.
I see newVirtualMachineClusterPreference
, same for newVirtualMachineClusterInstancetype
?
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 have added labels to these functions as well.
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.
/lgtm
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.
Looks good to me, lets just close the gaps we have here.
ExpectWithOffset(1, err).ToNot(HaveOccurred()) | ||
return &preference.Spec, nil | ||
case *instancetypev1alpha2.VirtualMachineClusterPreference: | ||
ExpectWithOffset(1, namespaced).To(BeFalse(), "expected VirtualMachineClusterPreference to be created") | ||
ExpectWithOffset(1, obj.Kind).To(Equal("VirtualMachineClusterPreference")) | ||
clusterPreference, err := virtClient.VirtualMachineClusterPreference().Create(context.Background(), (*instancetypev1alpha2.VirtualMachineClusterPreference)(obj), metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}}) | ||
obj.Labels = map[string]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.
+1 Can we have a quick look.
I see newVirtualMachineClusterPreference
, same for newVirtualMachineClusterInstancetype
?
70202e2
to
55b38ae
Compare
This commit adds labels to the VirtualMachineClusterInstancetype and VirtualMachineClusterPreference that ensures that these objects are deleted properly after the test run. Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
55b38ae
to
621da97
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xpivarc 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 |
/retest |
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.
/lgtm
/retest |
@opokornyy: The following test failed, say
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. I understand the commands that are listed here. |
/retest-required |
2 similar comments
/retest-required |
/retest-required |
What this PR does / why we need it:
This PR removes dryRun options and adds functionality to CleanNamespaces to remove VirtualMachinePreference and VirtualMachineClusterPreference instead. It also updates help message for this command.
Release note: