[REV] change windows path

This commit is contained in:
barnett 2018-12-11 15:36:49 +08:00
parent b69f0fdd8b
commit dc07f830b9

View File

@ -354,11 +354,23 @@ func RewriteHostPathInWindows(hostPath string) string {
if sharePath == "" {
sharePath = "/grdata"
}
hostPath = strings.Replace(hostPath, "/grdata", `z:\`, 1)
hostPath = strings.Replace(hostPath, "/grdata", `z:`, 1)
hostPath = strings.Replace(hostPath, "/", `\`, -1)
return hostPath
}
//RewriteContainerPathInWindows mount path in windows
func RewriteContainerPathInWindows(mountPath string) string {
if mountPath == "" {
return ""
}
if mountPath[0] == '/' {
mountPath = `c:\` + mountPath[1:]
}
mountPath = strings.Replace(mountPath, "/", `\`, -1)
return mountPath
}
type volumeDefine struct {
as *v1.AppService
volumeMounts []corev1.VolumeMount