Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use labels in subDir #791

Open
mmelcot opened this issue Nov 13, 2024 · 4 comments
Open

Cannot use labels in subDir #791

mmelcot opened this issue Nov 13, 2024 · 4 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@mmelcot
Copy link

mmelcot commented Nov 13, 2024

What happened:
When creating a StorageClass, if one use labels of a PVC or PV in the subDir, it is not correctely interpreted.

What you expected to happen:
I expect the NFS CSI storage class to create a folder hierarchy in the NFS server, using the label foo from my pvc.
Instead, I got something like:

          my_namespace
              ${pvc.metadata.labels.foo}
                     my_pvc_name

i.e. that the labels are not correctly interpreted.

How to reproduce it:
Define a StorageClass in which you configured subDir with something like:
subDir: ${pvc.metadata.namespace}/${pvc.metadata.labels.foo}/${pvc.metadata.name}

And then create a PVC with:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
  labels:
    foo: "bar"

Create a pod using that PVC, and check which folder hierarchy it creates in the NFS

Environment:

  • CSI Driver version: registry.k8s.io/sig-storage/nfsplugin:v4.9.0
  • Kubernetes version (use kubectl version):
Client Version: v1.31.2
Kustomize Version: v5.4.2
Server Version: v1.30.3+k3s1
  • OS (e.g. from /etc/os-release): Ubuntu 22.04.5 LTS
  • Kernel (e.g. uname -a): Linux 6.8.0-48-generic #48~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 7 11:24:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
@andyzhangx
Copy link
Member

only following metadata is supported per the doc: https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/docs/driver-parameters.md#subdir-parameter-supports-following-pvpvc-metadata-conversion

${pvc.metadata.name}
${pvc.metadata.namespace}
${pv.metadata.name}

@mmelcot
Copy link
Author

mmelcot commented Nov 25, 2024

ah ok, thanks @andyzhangx for the clarification.

Well, that would be great if that list could be extended in a future version of csi-driver-nfs...

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 23, 2025
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants