MIG-1963: Add csi.trident.netapp.io to accessModeList for correct access/volume mode detection - #1467
Open
swshende-cmd wants to merge 1 commit into
Open
Conversation
The accessModeList only contained the legacy Trident provisioner name (netapp.io/trident). Modern NetApp Trident CSI StorageClasses use csi.trident.netapp.io, which did not match, causing accessModesForProvisioner() to fall back to ReadWriteOnce/Filesystem only — silently dropping Block and ReadWriteMany support. Add a new accessModeList entry for csi.trident.netapp.io alongside the existing legacy entry to correctly report supported access modes for both provisioner names. Closes: https://redhat.atlassian.net/browse/MIG-1963 Ref: migtools#1366 Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds CSI Trident filesystem and block access-mode mappings and tests ChangesStorage access mode resolution
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MigCluster/MigPlan status incorrectly reports storage classes backed by the NetApp Trident CSI driver (
csi.trident.netapp.io) as supporting onlyReadWriteOnce+volumeMode: Filesystem, even when the underlying storage supportsReadWriteMany+volumeMode: Block. This blocks VM/Block-mode storage migrations for customers on NetApp Trident CSI.Root cause: The
accessModeListinmigcluster_types.goonly contained the legacy Trident provisioner namenetapp.io/tridentwith exact string matching. Modern Trident CSI StorageClasses use provisionercsi.trident.netapp.io, which never matches, causingaccessModesForProvisioner()to fall back to defaults:[ReadWriteOnce]for Filesystem andnil(dropped) for Block.Fix: Add a new
accessModeListentry forcsi.trident.netapp.ioalongside the existing legacy entry. This is purely additive — no existing entries or logic are modified.Changes
pkg/apis/migration/v1alpha1/migcluster_types.gocsi.trident.netapp.ioentry toaccessModeList(+8 lines)pkg/apis/migration/v1alpha1/migcluster_types_test.goaccessModesForProvisioner()(+94 lines)Test Evidence
1. Unit Tests — 12/12 PASS
2. Cluster Integration Test — OCP 4.22.3
Tested against live OCP cluster (
api.swshende.vmware.gsslab.pnq2.redhat.com:6443, OCP 4.22.3) with mock StorageClassesontap-san-trident-csi(provisioner:csi.trident.netapp.io) andontap-san-trident-legacy(provisioner:netapp.io/trident).BEFORE (unfixed code) — Bug reproduced
GetStorageClasses()returns wrong access modes forcsi.trident.netapp.io:{ "name": "ontap-san-trident-csi", "provisioner": "csi.trident.netapp.io", "volumeAccessModes": [ { "volumeMode": "Filesystem", "accessModes": ["ReadWriteOnce"] } ] }ReadWriteOnce(missingReadOnlyMany)nil— dropped from output)netapp.io/trident: correctAFTER (fixed code) — Bug fixed
{ "name": "ontap-san-trident-csi", "provisioner": "csi.trident.netapp.io", "volumeAccessModes": [ { "volumeMode": "Filesystem", "accessModes": ["ReadWriteOnce", "ReadOnlyMany"] }, { "volumeMode": "Block", "accessModes": ["ReadWriteOnce", "ReadOnlyMany", "ReadWriteMany"] } ] }[ReadWriteOnce, ReadOnlyMany][ReadWriteOnce, ReadOnlyMany, ReadWriteMany](RWX present)netapp.io/trident: still correct (backward compatible)3. Full Test Suite — No Regressions
All packages that pass on unmodified master continue to pass with this change. Controller package failures (
fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory) are pre-existing and unrelated.4. Backward Compatibility
netapp.io/tridententry is untouched — existing customers unaffectedMade with Cursor
Summary by CodeRabbit
New Features
Bug Fixes