Skip to content

Does the nas driver have to access the cloud to get the source? #160

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

Closed
zjj2wry opened this issue Dec 2, 2024 · 3 comments
Closed

Does the nas driver have to access the cloud to get the source? #160

zjj2wry opened this issue Dec 2, 2024 · 3 comments

Comments

@zjj2wry
Copy link

zjj2wry commented Dec 2, 2024

Can source information be obtained from pv context to avoid additional calls?

client, err := ns.Driver.cloud.SFSV2Client()
if err != nil {
klog.V(3).Infof("NodePublishVolume Failed to create SFS v2 client: %v", err)
return nil, status.Error(codes.Internal, err.Error())
}
share, err := getShare(client, volumeID)
if err != nil {
if _, ok := err.(golangsdk.ErrDefault404); ok {
return nil, status.Error(codes.NotFound, fmt.Sprintf("NodePublishVolume Volume %s not found", volumeID))
}
return nil, status.Error(codes.Internal, fmt.Sprintf("NodePublishVolume %v", err))
}
//Get Volume export location
source := share.ExportLocation
if (len(source) == 0) && (len(share.ExportLocations) > 0) {
source = share.ExportLocations[0]
}
if len(source) == 0 {
return nil, status.Error(codes.Internal, fmt.Sprintf("NodePublishVolume Volume %s location not found", volumeID))
}

@chengxiangdong
Copy link
Collaborator

chengxiangdong commented Jan 7, 2025

Hi @zjj2wry, 我没太明白你的意思 : )

@zjj2wry
Copy link
Author

zjj2wry commented Jan 7, 2025

Hi @zjj2wry, 我没太明白你的意思 : )

sfs 的 csi-plugin 必须要依赖 sfs client 么?不能从 pv 中拿到 source 信息么,我的场景是在其他云的 kubernetes 上使用华为云的 nas 盘,我想在其他的云上部署一个华为的 nas csi-plugin

@chengxiangdong
Copy link
Collaborator

明白你的意思了,目前 CSI 仅支撑在华为云上自建k8s集群中运行,如k8s集群不在华为云则不支持。

@zjj2wry zjj2wry closed this as completed Jan 8, 2025
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