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

Graduate the clone API to v1beta1 and deprecate v1alpha1 #13520

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

iholder101
Copy link
Contributor

@iholder101 iholder101 commented Dec 15, 2024

What this PR does

The clone API was introduced about a year and a half ago: #7336.
Since then, it had been used by both our functional test suite, but also by real-life users.

Therefore, this PR graduates the API from v1alpha1 to v1beta1, and deprecates the former.

p.s. a user-guide update is ready to merge after this would get in: kubevirt/user-guide#859.

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note

Graduate the clone API to v1beta1 and deprecate v1alpha1

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Dec 15, 2024
@kubevirt-bot kubevirt-bot added size/XXL area/controller area/virtctl kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/buildsystem Denotes an issue or PR that relates to changes in the build system. sig/compute sig/storage labels Dec 15, 2024
@dosubot dosubot bot added the kind/deprecation Indicates the PR/issue deprecates a feature that will be removed in a subsequent release. label Dec 15, 2024
iholder101 added a commit to iholder101/kubevirt-user-guide that referenced this pull request Dec 15, 2024
Copy link
Member

@Barakmor1 Barakmor1 left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. I have a small question.

@iholder101 iholder101 force-pushed the graduate/clone-v1beta1 branch from 80aea0b to 40a278b Compare December 15, 2024 16:31
Copy link
Member

@Barakmor1 Barakmor1 left a comment

Choose a reason for hiding this comment

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

I think we should also change:

VIRTUALMACHINECLONE = "virtualmachineclones." + clonev1alpha1.VirtualMachineCloneKind.Group

like they did with snapshot transition to beta:

6202f83

"kubevirt.io/api/clone"
clonev1alpha1 "kubevirt.io/api/clone/v1alpha1"
clonebase "kubevirt.io/api/clone"
clone "kubevirt.io/api/clone/v1beta1"
Copy link
Member

Choose a reason for hiding this comment

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

+1 for the alias

Copy link
Contributor

Choose a reason for hiding this comment

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

would you not prefer clonev1 instead of clone? from my experience that is usually the naming pattern for kube APIs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't clonev1 for the v1 version?
My idea here is to name it generically as clone which serves as the latest version of clone. This way when we'll decide to bump it to v1 we won't need to rename the alias.

TBH I don't feel strongly on this, but think if we want to change it then clonev1beta1 or clonebeta1 would be better than clonev1. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

it's fine, you can keep this

@iholder101 iholder101 force-pushed the graduate/clone-v1beta1 branch 3 times, most recently from 4d9623c to 293fcd4 Compare December 17, 2024 07:34
@iholder101
Copy link
Contributor Author

I think we should also change:

VIRTUALMACHINECLONE = "virtualmachineclones." + clonev1alpha1.VirtualMachineCloneKind.Group

like they did with snapshot transition to beta:

6202f83

I switched to clone.GroupName which is more generic, as it would suit all versions (BTW technically, clone.GroupName, clonev1alpha1.VirtualMachineCloneKind.Group and clonev1beta1.VirtualMachineCloneKind.Group are equal, but I agree that setting the alpha group name is misleading).

Thank you!

Copy link
Member

@Barakmor1 Barakmor1 left a comment

Choose a reason for hiding this comment

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

Thank you!
/lgtm

Comment on lines 875 to 880
Name: clonev1alpha1.SchemeGroupVersion.Version,
Served: true,
Storage: false,
Deprecated: true,
DeprecationWarning: pointer.P("clone.kubevirt.io/v1alpha1 VirtualMachineClone is now deprecated and will be removed in v1."),
},
{
Name: clonev1beta1.SchemeGroupVersion.Version,
Copy link
Member

@Barakmor1 Barakmor1 Dec 17, 2024

Choose a reason for hiding this comment

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

nit: I'ts probably the default value, i can't find it in the docs but with other objects we add:

		Conversion: &extv1.CustomResourceConversion{
			Strategy: extv1.NoneConverter,
		},

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching that!
I've verified that it is the default value:

func SetDefaults_CustomResourceDefinitionSpec(obj *CustomResourceDefinitionSpec) {
	if len(obj.Names.Singular) == 0 {
		obj.Names.Singular = strings.ToLower(obj.Names.Kind)
	}
	if len(obj.Names.ListKind) == 0 && len(obj.Names.Kind) > 0 {
		obj.Names.ListKind = obj.Names.Kind + "List"
	}
	if obj.Conversion == nil {
		obj.Conversion = &CustomResourceConversion{
			Strategy: NoneConverter,
		}
	}
}

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 17, 2024
@iholder101
Copy link
Contributor Author

@mhenriks do you mind having a look? thanks!

@kubevirt-bot
Copy link
Contributor

Pull requests that are marked with lgtm should receive a review
from an approver within 1 week.

After that period the bot marks them with the label needs-approver-review.

/label needs-approver-review

@kubevirt-bot kubevirt-bot added the needs-approver-review Indicates that a PR requires a review from an approver. label Dec 25, 2024
@iholder101
Copy link
Contributor Author

@ShellyKa13 @akalenyu can one of you please review as storage approvers?

@iholder101
Copy link
Contributor Author

ping @ShellyKa13 @akalenyu

@akalenyu
Copy link
Contributor

akalenyu commented Jan 1, 2025

While this is not a big deal, I recalled us not deprecating alpha on this change for the snapshot/export APIs
https://github.com/kubevirt/kubevirt/pulls?q=is%3Apr+author%3Amhenriks+v1beta1+is%3Amerged+
/lgtm

@iholder101 iholder101 force-pushed the graduate/clone-v1beta1 branch from 293fcd4 to 06fdd45 Compare January 2, 2025 08:03
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 2, 2025
@kubevirt-bot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

Signed-off-by: Itamar Holder <[email protected]>
Generated with "make generate"

Signed-off-by: Itamar Holder <[email protected]>
Also refactor import aliases:
clonebase "kubevirt.io/api/clone"
clonev1alpha1 "kubevirt.io/api/clone/v1alpha1"
clonev1beta1 "kubevirt.io/api/clone/v1beta1"

Signed-off-by: Itamar Holder <[email protected]>
By running "make generate"

Signed-off-by: Itamar Holder <[email protected]>
Signed-off-by: Itamar Holder <[email protected]>
Signed-off-by: Itamar Holder <[email protected]>
@iholder101 iholder101 force-pushed the graduate/clone-v1beta1 branch from 06fdd45 to 63a5841 Compare January 2, 2025 08:13
@iholder101
Copy link
Contributor Author

While this is not a big deal, I recalled us not deprecating alpha on this change for the snapshot/export APIs kubevirt/kubevirt/pulls (author:mhenriks v1beta1 is:merged)

Thank you @akalenyu!
I followed your approach and removed the deprecation 👍

/lgtm

Thanks for the LGTM 😄 but TBH I was expecting you'd review this as an approver and not a reviewer.

We're new to this, but in general this is the new review workflow as I see it:

  • PR is being reviewed by a reviewer, which LGTMs.
  • The PR owner pings relevant SIG approvers, each SIG approver approves their field (storage/network/etc).
  • Optionally, only if necessary, a root approver approves files that aren't owned by any SIGs yet.

Would you mind reviewing this as a storage-approver and /approve if you think the PR is ready?

@akalenyu
Copy link
Contributor

akalenyu commented Jan 2, 2025

While this is not a big deal, I recalled us not deprecating alpha on this change for the snapshot/export APIs kubevirt/kubevirt/pulls (author:mhenriks v1beta1 is:merged)

Thank you @akalenyu! I followed your approach and removed the deprecation 👍

/lgtm

Thanks for the LGTM 😄 but TBH I was expecting you'd review this as an approver and not a reviewer.

We're new to this, but in general this is the new review workflow as I see it:

  • PR is being reviewed by a reviewer, which LGTMs.
  • The PR owner pings relevant SIG approvers, each SIG approver approves their field (storage/network/etc).
  • Optionally, only if necessary, a root approver approves files that aren't owned by any SIGs yet.

Would you mind reviewing this as a storage-approver and /approve if you think the PR is ready?

gotcha
/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akalenyu
Once this PR has been reviewed and has the lgtm label, please ask for approval from iholder101. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@iholder101
Copy link
Contributor Author

@enp0s3 mind having another look?

@akalenyu
Copy link
Contributor

akalenyu commented Jan 2, 2025

@iholder101: The following tests 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-check-tests-for-flakes 293fcd4 link false /test pull-kubevirt-check-tests-for-flakes
pull-kubevirt-e2e-k8s-1.32-sig-storage 63a5841 link false /test pull-kubevirt-e2e-k8s-1.32-sig-storage

@alicefr it's quite common for these health checks to fail after the persistent reservation tests, but I am not sure why. From a glance it looks like it waits for kubevirt to stabilize

@akalenyu
Copy link
Contributor

akalenyu commented Jan 2, 2025

/test pull-kubevirt-e2e-k8s-1.32-sig-storage

@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Jan 2, 2025

@iholder101: 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-check-tests-for-flakes 63a5841 link false /test pull-kubevirt-check-tests-for-flakes

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-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller area/virtctl dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/deprecation Indicates the PR/issue deprecates a feature that will be removed in a subsequent release. needs-approver-review Indicates that a PR requires a review from an approver. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/buildsystem Denotes an issue or PR that relates to changes in the build system. sig/compute sig/storage size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants