Skip to content

Feat/nfs export names - #6497

Merged
nixpanic merged 2 commits into
ceph:develfrom
IanEff:feat/nfs-export-names
Sep 11, 2026
Merged

Feat/nfs export names#6497
nixpanic merged 2 commits into
ceph:develfrom
IanEff:feat/nfs-export-names

Conversation

@IanEff

@IanEff IanEff commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Describe what this PR does

NFS export names are currently derived from ComposeCSIID(), a long alphanumeric string that's meaningless to humans. This PR adds an opt-in friendlyExportNames StorageClass parameter that names exports <namespace>/<pvc-name> instead.

The name is sourced from PVC metadata supplied by the external provisioner, enabled with --extra-create-metadata=true, and persisted in the CephFS journal so that DeleteExport and SetClients can resolve the volume path later on.

Is there anything that requires special attention

This feature is gated behind an explicit StorageClass parameter rather than firing automatically whenever --extra-create-metadata is set because that flag is already used unconditionally by the CephFS backend for per-tenant KMS scoping.

It's entirely backwards compatible, as the parameter is set to off by default. No existing exports are affected

Related issues

Fixes: #4414

Future concerns

None.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow
    guidelines in the developer
    guide
    .
  • Reviewed the developer guide on Submitting a Pull
    Request
  • Pending release
    notes

    updated with breaking and/or notable changes for the next major release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

Show available bot commands

These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:

  • /retest ci/centos/<job-name>: retest the <job-name> after unrelated
    failure (please report the failure too!)

CI job ordering.

Depends-on: #6512

@IanEff
IanEff requested review from a team as code owners August 25, 2026 11:36
@IanEff

IanEff commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

This doesn't address the degenerate export names issue. I'll re-submit.

@nixpanic nixpanic left a comment

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.

Looks reasonable, thanks for the PR.

Can you please create a clean series of commits, instead of fixups that tidy the code after it was added? Note that we do want Co-authored-by referencing your AI agent on each commit where it assisted.

It would be good to add a test-case in e2e/nfs.go for the functionality too.

Comment thread internal/nfs/types/volume.go
@nixpanic nixpanic added enhancement New feature or request component/nfs Issues related to NFS labels Aug 25, 2026
@IanEff

IanEff commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Both of those CI tests failed on downloading from the repo(https://download.ceph.com/rpm-${CEPH_VERSION}/el10/noarch/ceph-release-1-0.el10.noarch.rpm). I don't know that I can do anything about that.

@IanEff
IanEff force-pushed the feat/nfs-export-names branch from c1fbc81 to 8d96c63 Compare August 25, 2026 13:13
@IanEff

IanEff commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Can you please create a clean series of commits, instead of fixups that tidy the code after it was added?

Resubmitted. Thanks for the guidance!

nixpanic
nixpanic previously approved these changes Aug 26, 2026

@nixpanic nixpanic left a comment

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.

Thanks, this looks complete to me. Unfortunately we do not have any documentation specific to NFS (or other backends), otherwise it would have been nice to add this option and an example there.

@nixpanic
nixpanic requested a review from a team August 26, 2026 14:29
@nixpanic

Copy link
Copy Markdown
Member

@Mergifyio rebase

This will include the CI fixes.

@mergify

mergify Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

rebase

🛑 The pull request rule doesn't match anymore

Details

This action has been cancelled.

@ceph-csi-bot
ceph-csi-bot force-pushed the feat/nfs-export-names branch from 8d96c63 to 6dd8906 Compare August 26, 2026 15:11
@nixpanic

Copy link
Copy Markdown
Member

GitHub Actions are not running due to an outage

image

@nixpanic

Copy link
Copy Markdown
Member

@Mergifyio rebase

GitHub Workflows should work again.

@mergify

mergify Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

rebase

🛑 The pull request rule doesn't match anymore

Details

This action has been cancelled.

@ceph-csi-bot
ceph-csi-bot force-pushed the feat/nfs-export-names branch from 6dd8906 to e5d903a Compare August 27, 2026 13:28
Madhu-1
Madhu-1 previously approved these changes Sep 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Validation can orphan backend volumes, and the new E2E test lacks the required provisioner metadata flag.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds opt-in human-readable NFS export paths derived from PVC metadata.

Changes:

  • Persists friendly export names for create, delete, and client updates.
  • Detects export-name conflicts and documents the new StorageClass parameter.
  • Adds unit and end-to-end coverage.
File summaries
File Description
PendingReleaseNotes.md Documents the feature and conflict behavior.
internal/util/k8s/parameters.go Exposes PVC-name metadata.
internal/nfs/types/volume.go Persists and resolves friendly export paths.
internal/nfs/types/volume_test.go Tests export-path selection.
internal/nfs/types/errors.go Defines the export-name conflict error.
internal/nfs/controller/controllerserver.go Parses the option and maps conflicts.
internal/nfs/controller/controllerserver_test.go Tests friendly-name derivation.
examples/nfs/storageclass.yaml Documents StorageClass configuration.
e2e/utils.go Adds export pseudo-path lookup support.
e2e/nfs.go Adds a friendly-export-name scenario.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread e2e/nfs.go
Comment thread internal/nfs/controller/controllerserver.go Outdated
@IanEff
IanEff force-pushed the feat/nfs-export-names branch from e5d903a to bb171b7 Compare September 4, 2026 11:03
@mergify
mergify Bot dismissed stale reviews from nixpanic and Madhu-1 September 4, 2026 11:04

Pull request has been modified.

@IanEff

IanEff commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@Madhu-1 , @nixpanic: all Copilot issues addressed in the last PR.

Madhu-1
Madhu-1 previously approved these changes Sep 7, 2026
@Madhu-1
Madhu-1 requested a review from nixpanic September 7, 2026 05:09

@iPraveenParihar iPraveenParihar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! LGTM :)
have more info on the error logs

Comment thread internal/nfs/controller/controllerserver.go Outdated
Comment thread internal/nfs/controller/controllerserver.go Outdated
Comment thread PendingReleaseNotes.md
@mergify
mergify Bot dismissed Madhu-1’s stale review September 8, 2026 09:14

Pull request has been modified.

Unlike a volume-ID derived export name, "<namespace>/<pvc-name>" is
not guaranteed unique over time (e.g. a PVC recreated under the same
name before its old export was cleaned up). CreateExport treated any
"Export already exists" response as a safe idempotent retry, which
would silently reuse another volume's export and serve its data.

Compare the existing export's subvolume path before accepting the
collision as our own retry; otherwise fail with ErrExportNameConflict,
surfaced to CSI callers as codes.AlreadyExists.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Ian Furst <ian.furst@gmail.com>
@IanEff
IanEff force-pushed the feat/nfs-export-names branch from 2a544db to 794ff9e Compare September 10, 2026 12:36
@mergify
mergify Bot dismissed stale reviews from iPraveenParihar and Madhu-1 September 10, 2026 12:37

Pull request has been modified.

@nixpanic

Copy link
Copy Markdown
Member

/queue

@ceph-csi-bot ceph-csi-bot added the ok-to-test Label to trigger E2E tests label Sep 10, 2026
@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-cephfs

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.36

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-rbd

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.36

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.34

@ceph-csi-bot ceph-csi-bot added ci/in-progress/e2e This label acts like a guard and prevents Mergify from adding the `ok-to-test` label again. and removed ok-to-test Label to trigger E2E tests labels Sep 10, 2026
@mergify mergify Bot removed the ci/in-progress/e2e This label acts like a guard and prevents Mergify from adding the `ok-to-test` label again. label Sep 10, 2026
@nixpanic

Copy link
Copy Markdown
Member

/test ci/centos/k8s-e2e-external-storage/1.34

@nixpanic

Copy link
Copy Markdown
Member

/test ci/centos/k8s-e2e-external-storage/1.35

@nixpanic

Copy link
Copy Markdown
Member

/test ci/centos/k8s-e2e-external-storage/1.36

@nixpanic

Copy link
Copy Markdown
Member

/test ci/centos/upgrade-tests
/test ci/centos/mini-e2e/k8s-1.35

@IanEff

IanEff commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

/test ci/centos/mini-e2e/k8s-1.35

@mergify

mergify Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mergify

mergify Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

queue

🛑 This pull request comes from a fork and cannot be rebased on behalf of a user

Details

GitHub refuses an OAuth token on its rebase API for a fork, so rebasing a fork's pull request on behalf of a GitHub user means impersonating that user to force-push the contributor's branch. Mergify does not do that.

Unset update_bot_account on the default queue to keep queueing pull requests from forks: with no account to impersonate, the update rebases through GitHub's API as Mergify, which the installation token is allowed to do. A fork pull request that changes GitHub Actions workflows, or that another GitHub App's bot opened, is the exception: GitHub lets Mergify queue one in place only with an update_bot_account, so a queue that receives those has to run its checks on a draft pull request instead. update_method: merge works too, and merges the base branch into the pull request rather than rebasing it.

@nixpanic
nixpanic merged commit a06264b into ceph:devel Sep 11, 2026
40 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/nfs Issues related to NFS enhancement New feature or request queued/rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nfs: allow users to specify NFS export name

6 participants