Fix v3 hostpath path concatenate error (#1222)

This commit is contained in:
Hang Yan
2019-12-28 18:40:36 +08:00
committed by GitHub
parent ae138029a1
commit 25337eb82c
4 changed files with 30 additions and 3 deletions
+7 -1
View File
@@ -907,7 +907,13 @@ func (k *Kubernetes) ConfigHostPathVolumeSource(path string) (*api.VolumeSource,
if err != nil {
return nil, err
}
absPath := filepath.Join(dir, path)
absPath := path
if !filepath.IsAbs(path) {
absPath = filepath.Join(dir, path)
}
log.Debugf("fuck path: %s,%s", path, absPath)
return &api.VolumeSource{
HostPath: &api.HostPathVolumeSource{Path: absPath},
}, nil