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

The collection parameter in StorageClass does not take effect #188

Open
hanxiantao opened this issue Feb 5, 2025 · 1 comment
Open

The collection parameter in StorageClass does not take effect #188

hanxiantao opened this issue Feb 5, 2025 · 1 comment

Comments

@hanxiantao
Copy link

Issue Description

According to the documentation, I understand that when the collection parameter is specified in the StorageClass, it should be mapped to the bucket configured by the collection.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mycollection-seaweedfs-storage
provisioner: seaweedfs-csi-driver
parameters:
  collection: mycollection
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: Immediate

However, after my attempt, it did not execute as expected. It was still mapped to the default-generated /buckets/<volume-id>.

I checked the code and tried to configure the path parameter. After that, the mapped bucket was changed to the one specified in the path.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mycollection-seaweedfs-storage
provisioner: seaweedfs-csi-driver
parameters:
  collection: mycollection
  path: /buckets/lgwtest03
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: Immediate

Image

I initially think there is a problem with the code here. When the collection parameter is specified, it should affect the value of path, path = fmt.Sprintf("/buckets/%s", collection)
https://github.com/seaweedfs/seaweedfs-csi-driver/blob/c4af3d29895c8eeee4b7faf00b05b5792a3976aa/pkg/driver/mounter.go#L37C1-L49C2

@chrislusf
Copy link
Contributor

the collection must be the same as the bucket name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants