Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 1, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds driver.labels option to the helm chart, enabling custom labels on the CSIDriver resource.

This is needed for OpenShift environments where ephemeral CSI volumes require the security.openshift.io/csi-ephemeral-volume-profile label to use the restricted security profile instead of the default privileged profile.

Changes:

  • Added driver.labels: {} to values.yaml
  • Updated csi-smb-driver.yaml template to conditionally render labels
  • Regenerated helm package
  • Added driver.labels example to E2E_HELM_OPTIONS in Makefile for e2e testing

Usage:

driver:
  labels:
    security.openshift.io/csi-ephemeral-volume-profile: restricted

Or via CLI:

helm install csi-driver-smb ... \
  --set driver.labels.testlabel=testvalue

Which issue(s) this PR fixes:

Fixes #988

Requirements:

Special notes for your reviewer:

Pattern follows existing podLabels implementation. No labels rendered when driver.labels is empty (default).

Release note:

Add driver.labels helm value to set custom labels on CSIDriver resource
Original prompt

This section details on the original issue you should resolve

<issue_title>Allow setting labels for CSIDriver resource from helm charts</issue_title>
<issue_description>Is your feature request related to a problem?/Why is this needed
I want to use ephemeral CSI volumes on OpenShift, but this requires the privileged security profile by default.

It is however possible to change this for a specific driver by setting the following label on the CSIDriver resource:

kind: CSIDriver
metadata:
  name: smb.csi.k8s.io
  labels:
    security.openshift.io/csi-ephemeral-volume-profile: restricted 

See https://docs.okd.io/4.18/storage/container_storage_interface/ephemeral-storage-csi-inline.html

Describe the solution you'd like in detail
It would be nice if this label could be set using Helm values, e.g. driverLabels similar to how Pod labels can be configured with podLabels.

Describe alternatives you've considered
The alternative would be to set the label manually after installation but this is not a robust solution.

Additional context

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@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. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 1, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @Copilot. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 1, 2025
Copilot AI changed the title [WIP] Add support for setting labels in CSIDriver Helm charts feat: Add driver.labels option to helm chart for CSIDriver resource Dec 1, 2025
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 1, 2025
Copilot AI requested a review from andyzhangx December 1, 2025 13:58
Copilot finished work on behalf of andyzhangx December 1, 2025 13:58
@andyzhangx
Copy link
Member

@copilot can you add an example helm chart option here for e2e test?

E2E_HELM_OPTIONS ?= --set image.smb.repository=$(REGISTRY)/$(IMAGENAME) --set image.smb.tag=$(IMAGE_VERSION) --set controller.runOnControlPlane=true

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Dec 1, 2025
Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

@copilot can you add an example helm chart option here for e2e test?

E2E_HELM_OPTIONS ?= --set image.smb.repository=$(REGISTRY)/$(IMAGENAME) --set image.smb.tag=$(IMAGE_VERSION) --set controller.runOnControlPlane=true

Added --set driver.labels.testlabel=testvalue to E2E_HELM_OPTIONS in Makefile (f338d12).

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 1, 2025
Copilot finished work on behalf of andyzhangx December 1, 2025 14:06
Copilot finished work on behalf of andyzhangx December 1, 2025 14:11
Copilot AI requested a review from andyzhangx December 1, 2025 14:11
@andyzhangx andyzhangx marked this pull request as ready for review December 1, 2025 14:17
@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 Dec 1, 2025
@k8s-ci-robot k8s-ci-robot requested a review from jingxu97 December 1, 2025 14:17
Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 1, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19825375482

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 78.507%

Totals Coverage Status
Change from base Build 19566127948: 0.0%
Covered Lines: 1125
Relevant Lines: 1433

💛 - Coveralls

Copy link
Member

@andyzhangx andyzhangx 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 k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 2, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, Copilot

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 2, 2025
@k8s-ci-robot k8s-ci-robot merged commit 20f77ec into master Dec 2, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow setting labels for CSIDriver resource from helm charts

4 participants