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

Merged
merged 6 commits into from
Jan 15, 2025

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

@Barakmor1
Copy link
Member

/lgtm

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

iholder101 commented Jan 13, 2025

@Barakmor1 can you PTAL? @enp0s3 you're welcome to review as well

sig-storage folks: let me know if you have any concerns. If not, I'll re-approve on the basis of #13520 (comment).

re-approving.
Thanks @Barakmor1 and @akalenyu for your review!

@iholder101
Copy link
Contributor Author

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akalenyu, iholder101

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 Jan 13, 2025
@kubevirt-commenter-bot
Copy link

Required labels detected, running phase 2 presubmits:
/test pull-kubevirt-e2e-windows2016
/test pull-kubevirt-e2e-kind-1.30-vgpu
/test pull-kubevirt-e2e-kind-sriov
/test pull-kubevirt-e2e-k8s-1.30-ipv6-sig-network
/test pull-kubevirt-e2e-k8s-1.30-sig-network
/test pull-kubevirt-e2e-k8s-1.30-sig-storage
/test pull-kubevirt-e2e-k8s-1.30-sig-compute
/test pull-kubevirt-e2e-k8s-1.30-sig-operator
/test pull-kubevirt-e2e-k8s-1.31-sig-network
/test pull-kubevirt-e2e-k8s-1.31-sig-storage
/test pull-kubevirt-e2e-k8s-1.31-sig-compute
/test pull-kubevirt-e2e-k8s-1.31-sig-operator

@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 added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 13, 2025
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 63a5841 to 3b2ab16 Compare January 14, 2025 11:12
@kubevirt-bot kubevirt-bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 14, 2025
@iholder101
Copy link
Contributor Author

Rebased (a minor bazel file conflict).

@Barakmor1 mind re-LGTMing?

@ShellyKa13
Copy link
Contributor

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 15, 2025
@kubevirt-commenter-bot
Copy link

Required labels detected, running phase 2 presubmits:
/test pull-kubevirt-e2e-windows2016
/test pull-kubevirt-e2e-kind-1.30-vgpu
/test pull-kubevirt-e2e-kind-sriov
/test pull-kubevirt-e2e-k8s-1.30-ipv6-sig-network
/test pull-kubevirt-e2e-k8s-1.30-sig-network
/test pull-kubevirt-e2e-k8s-1.30-sig-storage
/test pull-kubevirt-e2e-k8s-1.30-sig-compute
/test pull-kubevirt-e2e-k8s-1.30-sig-operator
/test pull-kubevirt-e2e-k8s-1.31-sig-network
/test pull-kubevirt-e2e-k8s-1.31-sig-storage
/test pull-kubevirt-e2e-k8s-1.31-sig-compute
/test pull-kubevirt-e2e-k8s-1.31-sig-operator

@kubevirt-bot
Copy link
Contributor

@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-e2e-k8s-1.30-sig-operator 3b2ab16 link unknown /test pull-kubevirt-e2e-k8s-1.30-sig-operator

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.

@iholder101
Copy link
Contributor Author

As per

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 👍

/remove-kind deprecation

@kubevirt-bot kubevirt-bot removed the kind/deprecation Indicates the PR/issue deprecates a feature that will be removed in a subsequent release. label Jan 15, 2025
@kubevirt-bot kubevirt-bot merged commit 1bf5c68 into kubevirt:main Jan 15, 2025
28 of 39 checks passed
@kubevirt-bot
Copy link
Contributor

/remove-label needs-approver-review

@kubevirt-bot kubevirt-bot removed the needs-approver-review Indicates that a PR requires a review from an approver. label Jan 15, 2025
kubevirt-bot pushed a commit to kubevirt/user-guide that referenced this pull request Feb 17, 2025
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. 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 lgtm Indicates that a PR is ready to be merged. 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.

6 participants