Skip to content

SVM: bump the API to beta, remove unused fields#134784

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
michaelasp:svm_beta2
Oct 29, 2025
Merged

SVM: bump the API to beta, remove unused fields#134784
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
michaelasp:svm_beta2

Conversation

@michaelasp
Copy link
Copy Markdown
Contributor

@michaelasp michaelasp commented Oct 22, 2025

What type of PR is this?

/kind feature /kind api-change

What this PR does / why we need it:

This PR bumps the SVM API to beta and removes the StorageVersionMigration object's fields as discussed in kubernetes/enhancements#5597, follow up to #134480

Which issue(s) this PR is related to:

KEP: kubernetes/enhancements#4192

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Add StorageVersionMigration v1beta1 api and remove the v1alpha API. 

Action required: Any use of the v1alpha1 api is no longer supported and 
users must remove any v1alpha1 resources prior to upgrade.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

KEP: KEP: https://github.com/kubernetes/enhancements/issues/4192

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Oct 22, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@michaelasp: The label(s) kind//kind cannot be applied, because the repository doesn't have them.

Details

In response to this:

What type of PR is this?

/kind feature /kind api-change

What this PR does / why we need it:

This PR bumps the SVM API to beta and removes the StorageVersionMigration object's fields as discussed in kubernetes/enhancements#5597, follow up to #134480

Which issue(s) this PR is related to:

KEP: kubernetes/enhancements#4192

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Add StorageVersionMigration v1beta1 api

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

KEP: KEP: https://github.com/kubernetes/enhancements/issues/4192

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 22, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Oct 22, 2025
@michaelasp
Copy link
Copy Markdown
Contributor Author

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. area/apiserver area/code-generation area/test sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/etcd Categorizes an issue or PR as relevant to SIG Etcd. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 22, 2025
@github-project-automation github-project-automation Bot moved this to Needs Triage in SIG Apps Oct 22, 2025
@michaelasp michaelasp force-pushed the svm_beta2 branch 2 times, most recently from 563a796 to daf0351 Compare October 22, 2025 18:10
@k8s-triage-robot
Copy link
Copy Markdown

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@michaelasp michaelasp force-pushed the svm_beta2 branch 2 times, most recently from d15fca7 to 1211458 Compare October 22, 2025 21:17
@michaelasp
Copy link
Copy Markdown
Contributor Author

/cc @enj
/cc @jpbetz

@k8s-ci-robot k8s-ci-robot requested a review from enj October 22, 2025 21:21
Comment thread pkg/printers/internalversion/printers.go Outdated
Comment thread pkg/printers/internalversion/printers.go Outdated
Comment thread pkg/controller/garbagecollector/graph_builder.go Outdated
Comment thread pkg/apis/storagemigration/types.go
Comment thread pkg/printers/internalversion/printers.go Outdated
Comment thread pkg/printers/internalversion/printers.go Outdated
Copy link
Copy Markdown
Member

@enj enj left a comment

Choose a reason for hiding this comment

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

Second pass.

Comment on lines 1007 to 1019
for monitorGVR, m := range gb.monitors {
if monitorGVR.Group == resource.Group && monitorGVR.Resource == resource.Resource {
if monitorGVR.Group == resource.Group &&
monitorGVR.Resource == resource.Resource &&
monitorGVR.Version == resource.Version {
monitor = m
break
}
}
}

if monitor == nil {
return nil, fmt.Errorf("no monitor found for resource %s", resource.String())
return nil, false, fmt.Errorf("no monitor found for resource %s", resource.String())
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Delete the var and loop altogether:

monitor, ok := gb.monitors[resource]
if !ok {
    return nil, false, fmt.Errorf("no monitor found for resource %s", resource.String())
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, missed that. At this point we know the exact gvr.

Comment on lines +1031 to +1033
// returning monitor to allow the caller to decide whether to retry as it can be synced later
return resourceMonitor, fmt.Errorf("dependency graph for resource %s is not synced", resource.String())
return resourceMonitor, false, nil
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just return nil, false, nil here and drop the comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch.

Comment on lines +73 to 74
if err != nil || cmp != 0 {
allErrs = append(allErrs, field.Invalid(fldPath.Child("resourceVersion"), newSVMBundle.Status.ResourceVersion, err.Error()))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will now panic if err == nil

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, this is a weird error, create an error if one doesn't exist.

Comment thread pkg/apis/storagemigration/validation/validation_test.go
Comment thread pkg/controller/storageversionmigrator/storageversionmigrator.go Outdated
Comment thread pkg/controller/storageversionmigrator/storageversionmigrator.go Outdated
Comment thread pkg/controller/storageversionmigrator/storageversionmigrator.go Outdated
Comment thread pkg/controller/storageversionmigrator/resourceversion.go Outdated
Comment thread pkg/controller/storageversionmigrator/resourceversion_test.go Outdated
@michaelasp michaelasp force-pushed the svm_beta2 branch 4 times, most recently from ddaf542 to e66dd9d Compare October 29, 2025 18:52
Copy link
Copy Markdown
Member

@enj enj left a comment

Choose a reason for hiding this comment

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

Last thing.

allErrs = append(allErrs, field.Invalid(field.NewPath("resource"), newSVMBundle.Spec.Resource.Resource, "field is immutable"))
}
// prevent changes to the spec
allErrs = append(allErrs, apivalidation.ValidateImmutableField(oldSVMBundle.Spec, newSVMBundle.Spec, field.NewPath("spec"))...)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So the error message returned is correct:

Suggested change
allErrs = append(allErrs, apivalidation.ValidateImmutableField(oldSVMBundle.Spec, newSVMBundle.Spec, field.NewPath("spec"))...)
allErrs = append(allErrs, apivalidation.ValidateImmutableField(newSVMBundle.Spec, oldSVMBundle.Spec, field.NewPath("spec"))...)

@michaelasp michaelasp force-pushed the svm_beta2 branch 3 times, most recently from 1b55e97 to 218635f Compare October 29, 2025 19:10
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Oct 29, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: michaelasp / name: Michael Aspinwall (3b72759)

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 29, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 29, 2025
Co-authored-by: Stanislav Láznička <[email protected]>
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

k8s-ci-robot commented Oct 29, 2025

@michaelasp: 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-kubernetes-apidiff-client-go 3b72759 link false /test pull-kubernetes-apidiff-client-go

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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.

@enj
Copy link
Copy Markdown
Member

enj commented Oct 29, 2025

/lgtm
/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: fd7f132701bf987b60a405f3f8879ceff3e0162e

@liggitt
Copy link
Copy Markdown
Member

liggitt commented Oct 29, 2025

/lgtm
/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enj, liggitt, michaelasp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/code-generation area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/etcd Categorizes an issue or PR as relevant to SIG Etcd. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

Status: API review completed, 1.35
Archived in project
Archived in project

Development

Successfully merging this pull request may close these issues.

8 participants