forked from LaconicNetwork/kompose
Fix v3 hostpath path concatenate error (#1222)
This commit is contained in:
@@ -164,9 +164,8 @@ func loadV3Volumes(volumes []types.ServiceVolumeConfig) []string {
|
||||
|
||||
var volArray []string
|
||||
for _, vol := range volumes {
|
||||
|
||||
// There will *always* be Source when parsing
|
||||
v := normalizeVolumes(vol.Source)
|
||||
v := vol.Source
|
||||
|
||||
if vol.Target != "" {
|
||||
v = v + ":" + vol.Target
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user