Skip to content

Update api versions to v1#218

Merged
Madhu-1 merged 7 commits intoceph:mainfrom
black-dragon74:conversion-webhook
Jun 3, 2025
Merged

Update api versions to v1#218
Madhu-1 merged 7 commits intoceph:mainfrom
black-dragon74:conversion-webhook

Conversation

@black-dragon74
Copy link
Member

@black-dragon74 black-dragon74 commented Mar 19, 2025

Describe what this PR does

This patch adds v1 API types for all the resources along with following changes:

  • v1alpha1 is now deprecated and a warning is issued when creating a resource for this version.
  • For existing installations, alpha APIs will be migrated to beta as a no-op conversion.
  • The version stored in etcd will be v1

To help review, please verify that for each API resource:

  • v1alpha1 is marked as deprecated using kubebuilder resource markers.
  • v1 is marked as the storage version.
  • The reconcilers and their tests inside internal/controller are updated to watch for v1

Everything else is mostly autogenerated code.

@black-dragon74
Copy link
Member Author

black-dragon74 commented Mar 19, 2025

Test results

# Action Create Version Get Version Expected Result Summary Deprecation Warning? v1-only Fields Present? Pass/Fail
1 Create & Get v1alpha1 v1alpha1 Returned as v1 internally, served as alpha; no v1-only fields shown
2 Create & Get v1 v1 Full compatibility; all fields retained
3 Create & Get v1 v1alpha1 v1-only fields omitted; shown as alpha
4 Create & Get v1alpha1 v1 Fields defaulted or missing; no v1-only values present unless added manually
5 Round-trip (v1 ➝ alpha ➝ v1) v1 v1 Some v1-only fields may be lost if mutated in alpha ✅ (on alpha get) Partial or ❌

Fields lost in xlation
6 Round-trip (alpha ➝ v1 ➝ alpha) v1alpha1 v1alpha1 v1 fields added in between should disappear on final alpha get
7 Add v1-only field in alpha v1alpha1 v1alpha1 Field ignored or rejected based on schema
8 Add v1-only field in v1 v1 v1 Field accepted and retained
9 List CRs v1alpha1 v1alpha1 All returned as alpha; no v1-only fields
10 List CRs v1 v1 All returned as v1; v1-only fields present
11 Delete in alpha (created in v1) v1 v1alpha1 Should successfully delete
12 Delete in v1 (created in alpha) v1alpha1 v1 Should successfully delete

@black-dragon74 black-dragon74 marked this pull request as draft March 19, 2025 13:39
@black-dragon74 black-dragon74 force-pushed the conversion-webhook branch 4 times, most recently from 8375da7 to 5dd4321 Compare March 20, 2025 17:08
@black-dragon74 black-dragon74 force-pushed the conversion-webhook branch 6 times, most recently from c4408a6 to 583761b Compare April 3, 2025 07:48
@nb-ohad
Copy link
Collaborator

nb-ohad commented Apr 9, 2025

This need further discussion. Adding a hold until we draw conclusions

@black-dragon74 black-dragon74 changed the title WIP: Update api versions to v1beta1 Update api versions to v1beta1 Apr 15, 2025
@black-dragon74 black-dragon74 marked this pull request as ready for review April 15, 2025 07:15
@travisn
Copy link
Member

travisn commented Apr 22, 2025

I would ask us to consider whether the version should be changed to v1beta, or whether it should be v1 (and skip v1beta1). My position is that there are many benefits of going directly to v1 now for several reasons.

  1. There is a development cost every time the version changes, as we see now in the conversion from v1alpha1. If we jump now to v1, we won’t have a future cost to again change the version from v1beta1.
  2. The CSI driver has already been stable for many years and we must replace it now with a stable CSI operator. Beta implies that it is not fully stable.
  3. Upgrades and backward compatibility must be supported, regardless of what version we set it to.
  4. The Rook and CephCSI community have always had a versioning policy that we support upgrades and backward compatibility, so the alpha/beta/v1 versions honestly aren’t significant for our community. The alpha/beta/v1 is really more of a K8s requirement where those version progressions have specific meaning for stability and adoption.
  5. Future upgrades can easily be supported even with schema changes, even if we declare v1 now. We’ve been doing it for years.

If we don’t go to v1 now, I ask that we have a very clear and concise requirement that describes why we can’t.

@travisn
Copy link
Member

travisn commented Apr 29, 2025

The test matrix looks very thorough to me, I don't have anything to add there. At least for upstream, I don't have concerns from Rook perspective about the upgrade path since it's still marked as experimental and break changes are acceptable.

Also a takeaway from the discussion today is that we will be plan on moving directly to v1, just to delay merging this for a few weeks, and then we can plan on testing integration with Rook, etc.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 29, 2025
@black-dragon74
Copy link
Member Author

Can we please keep this one open?

/cc: @Madhu-1 @nb-ohad

@Madhu-1 Madhu-1 removed the stale label May 30, 2025
@black-dragon74 black-dragon74 changed the title Update api versions to v1beta1 Update api versions to v1 Jun 3, 2025
@nb-ohad
Copy link
Collaborator

nb-ohad commented Jun 3, 2025

/unhold

nb-ohad
nb-ohad previously approved these changes Jun 3, 2025
@Madhu-1
Copy link
Collaborator

Madhu-1 commented Jun 3, 2025

/unhold

@nb-ohad we dont have automation for it as its upstream ceph org. its a manual step for now.

@black-dragon74 black-dragon74 force-pushed the conversion-webhook branch 2 times, most recently from fe727ba to a24cf29 Compare June 3, 2025 09:26
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
@black-dragon74 black-dragon74 requested a review from nb-ohad June 3, 2025 09:31
@Madhu-1 Madhu-1 merged commit 839de1d into ceph:main Jun 3, 2025
13 checks passed
black-dragon74 added a commit to black-dragon74/ceph-csi-operator that referenced this pull request Mar 2, 2026
This patch removes the resource definitions
for v1alpha1 APIs.

They were deprecated with: ceph#218

Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants