Skip to content

Commit bca4f8e

Browse files
author
smiletan
authored
Merge pull request #368 from catpineapple/fix-pvc-name
[fix](dcr) Avoid possible illegal strings in PVC name
2 parents d3899cf + fd4116a commit bca4f8e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/common/utils/doris/storage_conf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func GetNameOfEachPath(paths []string) []string {
9494
}
9595
res := make([]string, len(paths))
9696
for k := range paths {
97-
res[k] = pathName[paths[k]]
97+
res[k] = strings.ReplaceAll(pathName[paths[k]], "_", "-")
9898
}
9999
return res
100100
}

pkg/common/utils/resource/persistent_volume_claim.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ func GenerateEveryoneMountPathPersistentVolume(spec *dorisv1.BaseSpec, config ma
141141
tmp.MountPath = dataPaths[0]
142142
pvs = append(pvs, tmp)
143143
} else {
144-
pathName := doris.GetNameOfEachPath(dataPaths)
144+
pathNames := doris.GetNameOfEachPath(dataPaths)
145145
for i := range dataPaths {
146146
tmp := *template.DeepCopy()
147-
tmp.Name = tmp.Name + "-" + pathName[i]
147+
tmp.Name = tmp.Name + "-" + pathNames[i]
148148
tmp.MountPath = dataPaths[i]
149149
pvs = append(pvs, tmp)
150150
}

0 commit comments

Comments
 (0)