-
Notifications
You must be signed in to change notification settings - Fork 257
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
${pvc.metadata.name} returns the pvc's UID, not it's logical name #747
Comments
then what's incorrect? |
pvc.metadata.name should be the name, not the uid.
${pvc.metadata.namespace}/${pvc.metadata.name} uninitutively yields default/prime-152dfdb4-599d-4643-b52f-57212cdd8554 here instead of default/vm01-root |
can you share the [pod/csi-nfs-controller-74fc79867-m6s42/nfs] I0827 23:53:55.727919 1 utils.go:110] GRPC call: /csi.v1.Controller/CreateVolume |
Here are the equivalent logs:
Reminder that this is the openshift fork (https://github.com/openshift/csi-driver-nfs); do you think this is a problem with that fork or with openshift itself instead of the upstream here? |
the pvc name passed to csi driver is |
Right. Where does that come from? |
@jnm27 it's injected by the csi-provisioner |
Ok... who provides the csi-provisioner? What's the fix? Sorry for all the questions |
it's https://github.com/kubernetes-csi/external-provisioner --extra-create-metadata: Enables the injection of extra PVC and PV metadata as parameters when calling CreateVolume on the driver (keys: "csi.storage.k8s.io/pvc/name", "csi.storage.k8s.io/pvc/namespace", "csi.storage.k8s.io/pv/name") |
well, I tried taking out the --extra-create-metadata argument from the provisioner deployment spec, and it made it so the variables don't get replaced at all. ├── ${pvc.metadata.namespace} You mean I should open a ticket at https://github.com/kubernetes-csi/external-provisioner instead? |
can you try https://github.com/kubernetes-csi/csi-driver-nfs project? at least from e2e test logs, this project works. |
I see the same behavior with this project 4.8.0. |
@andyzhangx any other thoughts? Do you think it's something in particular to how Openshift is interfacing with the CSI driver, and I should open a Redhat ticket instead? It would be really useful to pinpoint what exactly Openshift is doing wrong from the perspective of this driver before going to them, though. |
What happened:
In the subdir field of the storage class, I am using
subDir: ${pvc.metadata.namespace}/${pvc.metadata.name}
The namespace is correct, but the name returns "prime-$UID", such as:
prime-968efac8-99c2-430d-8731-7714e424ad44
This gives no way of identifying the disk on the NFS server, especially if the server on which the PVC was originally created was lost.
The use case here is that a user could either re-attach a PVC, or delete the PVC, when re-installing a host and re-creating VMs under that host using NFS-backed storage.
Environment:
kubectl version
): v1.29.6uname -a
): Linux spt01.gl1.tfdm.nas.faa.gov 5.14.0-427.26.1.el9_4.x86_64 SMP PREEMPT_DYNAMIC Fri Jul 5 11:34:54 EDT 2024 x86_64 x86_64 x86_64 GNU/LinuxThe text was updated successfully, but these errors were encountered: