Skip to content

Conversation

@nixpanic
Copy link
Member

@nixpanic nixpanic commented Nov 7, 2025

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change

/kind bug

/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

Storage providers expect to obtain secrets from the
ControllerMoodifyVolume CSI procedure. Without these credentials, it may
not be possible to apply the parameters of a VolumeAttributeClass.

A CSIPersistentVolumeSource does not have ControllerModifySecretRef
(like ControllerExpandSecretRef), so in order to resolve credentials a
secret reference from annotations on the PersistentVolume are used:

  • volume.kubernetes.io/controller-modify-secret-name
  • volume.kubernetes.io/controller-modify-secret-namespace

In absence of these annotations, the ControllerExpandSecretRef of the
CSIPersistentVolumeSource used as a fallback.

Which issue(s) this PR fixes:

Related to kubernetes-csi/external-provisioner#1440

Special notes for your reviewer:

Posting this for early review. @gadididi is implementing ControllerModifyVolume in Ceph-CSI and found out about the missing secrets the hard way.

Approach has been discussed in a thread at #csi.

/cc carlory gnufied

Does this PR introduce a user-facing change?:

A StorageClass can use `csi.storage.k8s.io/controller-modify-secret-name` and `csi.storage.k8s.io/controller-modify-secret-namespace` to reference the credentials that should be used to modify a volume according to the parameters of a VolumeAttributeClass. In absence of these credentials, the credentials of `controller-expand-secret`are used as a fallback.

@k8s-ci-robot k8s-ci-robot requested a review from carlory November 7, 2025 09:34
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Nov 7, 2025
@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 7, 2025
@nixpanic
Copy link
Member Author

nixpanic commented Nov 7, 2025

Container image for testing at quay.io/nixpanic/csi-resizer:pr544.

@carlory
Copy link
Member

carlory commented Nov 7, 2025

/cc @sunnylovestiramisu
Please have a look when it is ready for review.

Storage providers expect to obtain secrets from the
ControllerMoodifyVolume CSI procedure. Without these credentials, it may
not be possible to apply the parameters of a VolumeAttributeClass.

A CSIPersistentVolumeSource does not have ControllerModifySecretRef
(like ControllerExpandSecretRef), so in order to resolve credentials a
secret reference from annotations on the PersistentVolume are used:
 - volume.kubernetes.io/controller-modify-secret-name
 - volume.kubernetes.io/controller-modify-secret-namespace

In absence of these annotations, the ControllerExpandSecretRef of the
CSIPersistentVolumeSource used as a fallback.
@nixpanic nixpanic force-pushed the ControllerModifyVolume/secrets branch from 7387c5a to c5bec27 Compare November 14, 2025 09:29
@nixpanic nixpanic marked this pull request as ready for review November 14, 2025 09:40
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 14, 2025
@nixpanic
Copy link
Member Author

@gnufied, this has been updated with the changes as discussed/proposed in the Slack #csi channel. kubernetes-csi/external-provisioner#1440 is the related change for the external-provisioner.

Copy link

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

LGTM

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Madhu-1, nixpanic
Once this PR has been reviewed and has the lgtm label, please assign xing-yang for approval. For more information see the Code Review Process.

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

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

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants