Skip to content

cleanup: validate unknown parameters in ControllerModifyVolume - #6458

Merged
mergify[bot] merged 2 commits into
ceph:develfrom
nixpanic:ControllerModifyVolume/InvalidArgument
Aug 10, 2026
Merged

cleanup: validate unknown parameters in ControllerModifyVolume#6458
mergify[bot] merged 2 commits into
ceph:develfrom
nixpanic:ControllerModifyVolume/InvalidArgument

Conversation

@nixpanic

@nixpanic nixpanic commented Aug 5, 2026

Copy link
Copy Markdown
Member

Add validation to reject unknown mutable parameters in ControllerModifyVolume.
Previously, unknown parameters were silently ignored, which could lead to
confusion when users specify incorrect parameter names.

Related: #6443

@nixpanic
nixpanic requested review from a team and gadididi August 5, 2026 11:23
@mergify mergify Bot added the cleanup label Aug 5, 2026
@nixpanic nixpanic added component/nfs Issues related to NFS component/nvme-of Issues and PRs related to NVMe-oF. labels Aug 5, 2026
Rakshith-R
Rakshith-R previously approved these changes Aug 5, 2026
black-dragon74
black-dragon74 previously approved these changes Aug 5, 2026
Comment thread internal/nvmeof/controller/controllerserver.go Outdated

@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.

few questions

Comment thread internal/nvmeof/controller/controllerserver.go Outdated
Comment thread internal/nfs/controller/controllerserver.go Outdated
@black-dragon74
black-dragon74 dismissed their stale review August 5, 2026 12:14

Outstanding reviews.

Comment thread internal/nvmeof/controller/controllerserver.go Outdated
@nixpanic
nixpanic force-pushed the ControllerModifyVolume/InvalidArgument branch from 3471981 to 3f7d560 Compare August 5, 2026 16:06
@mergify
mergify Bot dismissed Rakshith-R’s stale review August 5, 2026 16:10

Pull request has been modified.

@nixpanic
nixpanic force-pushed the ControllerModifyVolume/InvalidArgument branch from 3f7d560 to 218c870 Compare August 5, 2026 18:20
@nixpanic
nixpanic requested a review from a team as a code owner August 5, 2026 18:20
Comment thread internal/nvmeof/controller/controllerserver.go Outdated
Comment thread internal/nvmeof/controller/controllerserver.go Outdated
Comment thread internal/nvmeof/controller/controllerserver.go Outdated
Comment on lines +295 to +306
// Validate that only known parameters are provided (before any I/O)
knownParams := []string{
nfs.ParameterServer,
nfs.ParameterClients,
}

for param := range req.GetMutableParameters() {
if !slices.Contains(knownParams, param) {
return nil, status.Errorf(codes.InvalidArgument,
"unknown mutable parameter: %s", param)
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we need to have similar check before creating the subvolume or else we need a defer to cleanup the subvolume if anything fails after creation, i prefer to have input validation before loop of create/delete

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Currently CephFS does not support mutable parameters. But, well, #6390 is almost there now too. I'll add the extra checks/filtering in CreateVolume too, similar as what is done for nvmeof.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is done in the last update of this PR.

Copilot AI lite review requested due to automatic review settings August 6, 2026 08:29
@nixpanic
nixpanic force-pushed the ControllerModifyVolume/InvalidArgument branch from 218c870 to 6eca8d5 Compare August 6, 2026 08:29

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.

Pull request overview

This PR adds explicit validation for unknown mutable_parameters keys in ControllerModifyVolume (and NVMe-oF CreateVolume request validation), to avoid silently accepting typos/mistakes in VolumeAttributesClass mutable parameters.

Changes:

  • NVMe-oF: validate ControllerModifyVolume and CreateVolume request mutable_parameters to reject unknown keys.
  • NVMe-oF: avoid passing MutableParameters through to the RBD backend CreateVolume call.
  • NFS: avoid passing MutableParameters through to the CephFS backend CreateVolume call; validate ControllerModifyVolume mutable parameters.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
internal/nvmeof/controller/controllerserver.go Adds allowlist validation for NVMe-oF mutable parameters and strips mutable parameters from the RBD backend create request.
internal/nfs/controller/controllerserver.go Strips mutable parameters from the CephFS backend create request and adds allowlist validation for NFS mutable parameters.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/nfs/controller/controllerserver.go
Comment thread internal/nvmeof/controller/controllerserver.go
Comment thread internal/nvmeof/controller/controllerserver.go
gadididi
gadididi previously approved these changes Aug 6, 2026

@gadididi gadididi 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.

looks good thanks!

Add validation for unknown mutable parameters in ControllerModifyVolume
to catch configuration errors early.

Create a shared nvmeofMutableParams slice to define all valid NVMe-oF
mutable parameters in one place, eliminating code duplication.

Filter out NVMe-oF-specific mutable parameters before passing the
request to the RBD backend. NVMe-oF handles these parameters separately
through ControllerModifyVolume.

This prevents the RBD backend from receiving parameters it doesn't
understand, which would cause validation errors.

Remove redundant rbd.HasQoSParams() checks that became dead code after
the validation was moved earlier in the flow.

Assisted-by: AskBob <askbob@ibm.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
@ceph-csi-bot
ceph-csi-bot force-pushed the ControllerModifyVolume/InvalidArgument branch from 5977885 to b0daf72 Compare August 7, 2026 16:19
@nixpanic nixpanic added the ok-to-test Label to trigger E2E tests label Aug 7, 2026
@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-helm/k8s-1.34

@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/mini-e2e/k8s-1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

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

@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/k8s-e2e-external-storage/1.36

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

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

@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/upgrade-tests-cephfs

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-rbd

@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 Aug 7, 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 Aug 7, 2026
@Madhu-1

Madhu-1 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

@Mergifyio refresh

@mergify

mergify Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

refresh

✅ Pull request refreshed

@Madhu-1

Madhu-1 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

@Mergifyio refresh

@mergify

mergify Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

refresh

✅ Pull request refreshed

@mergify

mergify Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Deprecation notice: This pull request comes from a fork and was queued with update_method=rebase and update_bot_account impersonation. This capability will be removed on July 1, 2026. After this date, the merge queue will no longer be able to rebase fork pull requests with this configuration. To avoid disruption, switch to update_method=merge in your queue rule.

@Madhu-1 Madhu-1 added ci/skip/e2e skip running e2e CI jobs ci/skip/multi-arch-build skip building on multiple architectures labels Aug 10, 2026
@mergify mergify Bot added the queued label Aug 10, 2026
@mergify

mergify Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-10 04:38 UTC · Rule: default · triggered by merge protections
  • Checks skipped · PR is already up-to-date
  • Merged2026-08-10 04:39 UTC · at b0daf72f40cfb9655ee2e83dfd13789c1acdbf42 · rebase

This pull request spent 1 minute 12 seconds in the queue, including 3 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit 6bc6df3 into ceph:devel Aug 10, 2026
52 checks passed
@mergify mergify Bot removed the queued label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/skip/e2e skip running e2e CI jobs ci/skip/multi-arch-build skip building on multiple architectures cleanup component/nfs Issues related to NFS component/nvme-of Issues and PRs related to NVMe-oF.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants