Skip to content

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

Merged
merged 3 commits into from
Apr 27, 2023

Conversation

opokornyy
Copy link
Contributor

@opokornyy opokornyy commented Apr 13, 2023

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:

None

This commit removes dryRun options and adds functionality
to CleanNamespaces to remove VirtualMachinePreference and
VirtualMachineClusterPreference instead.

Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/S labels Apr 13, 2023
@kubevirt-bot kubevirt-bot requested review from EdDev and kbidarkar April 13, 2023 09:30
@opokornyy
Copy link
Contributor Author

/retest

@opokornyy
Copy link
Contributor Author

/cc @lyarwood @xpivarc @0xFelix

This commit updates help message for virtctl create
preference command.

Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
@0xFelix
Copy link
Member

0xFelix commented Apr 17, 2023

Looks good to me, is this needed for Instancetypes too?

@opokornyy
Copy link
Contributor Author

Looks good to me, is this needed for Instancetypes too?

It is already done for Instancetypes.

@opokornyy
Copy link
Contributor Author

/retest

Copy link
Member

@lyarwood lyarwood left a 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{})
Copy link
Member

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{
Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 19, 2023
Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Member

@xpivarc xpivarc left a 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{
Copy link
Member

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?

@kubevirt-bot kubevirt-bot added size/M and removed lgtm Indicates that a PR is ready to be merged. size/S labels Apr 26, 2023
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>
@xpivarc
Copy link
Member

xpivarc commented Apr 26, 2023

/approve

@kubevirt-bot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 26, 2023
@opokornyy
Copy link
Contributor Author

/retest

Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2023
@opokornyy
Copy link
Contributor Author

/retest

@kubevirt-bot
Copy link
Contributor

@opokornyy: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-fossa 621da97 link false /test pull-kubevirt-fossa

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.

@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

2 similar comments
@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot kubevirt-bot merged commit fe1052c into kubevirt:main Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants