Skip to content

Commit 9ca572b

Browse files
committed
Add comments to getMountInfo in pkg/ddc/base/runtime_helper.go
Signed-off-by: Equinocciox <231880504@smail.nju.edu.cn>
1 parent 341d7d9 commit 9ca572b

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

pkg/ddc/base/runtime_helper.go

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,15 @@ func (info *RuntimeInfo) getFuseDaemonset() (ds *appsv1.DaemonSet, err error) {
9494
return kubeclient.GetDaemonset(info.apiReader, fuseName, info.GetNamespace())
9595
}
9696

97-
// getMountInfo 从当前 RuntimeInfo 关联的 PersistentVolume 中提取挂载相关信息。
98-
//
99-
// 该函数首先根据 RuntimeInfo 中记录的 PV 名称,通过 kubeclient 获取对应的 PersistentVolume。
100-
// 如果获取失败,则返回错误,表示无法找到对应 PVC 绑定的 PV。
101-
//
102-
// 当 PV 的 Spec.CSI 字段存在且包含 VolumeAttributes 时,函数会从中解析出:
103-
// - path: Fluid 存储的实际路径(VolumeAttrFluidPath)
104-
// - mountType: 挂载类型(VolumeAttrMountType)
105-
// - subpath: 子路径(VolumeAttrFluidSubPath)
106-
//
107-
// 如果 PV 不是由 Fluid 创建(即 CSI 或其 VolumeAttributes 不存在),则返回错误。
108-
//
109-
// 返回值:
110-
// - path: 挂载路径
111-
// - mountType: 挂载类型
112-
// - subpath: 子路径
113-
// - err: 错误信息(若有)
97+
// getMountInfo fetches the PersistentVolume associated with the RuntimeInfo and
98+
// extracts mounting configurations.
99+
//
100+
// It expects the PV to be provisioned by Fluid with valid CSI VolumeAttributes.
101+
// Returns:
102+
// - path: The Fluid volume path.
103+
// - mountType: The storage protocol/type (e.g., oss, hdfs).
104+
// - subpath: The specific sub-directory within the volume.
105+
// - err: Error if the PV lookup fails or if the PV is not managed by Fluid.
114106
func (info *RuntimeInfo) getMountInfo() (path, mountType, subpath string, err error) {
115107
pv, err := kubeclient.GetPersistentVolume(info.apiReader, info.GetPersistentVolumeName())
116108
if err != nil {

0 commit comments

Comments
 (0)