namespace fro glusterfs

This commit is contained in:
GLYASAI 2020-05-08 13:59:00 +08:00
parent dc6ac4e29e
commit 6c65b247a3
2 changed files with 9 additions and 2 deletions

View File

@ -1117,6 +1117,9 @@ func (ctrl *ProvisionController) persistentVolumeForGrdata() (*v1.PersistentVolu
if err != nil {
return nil, fmt.Errorf("find pv for grdata: %v", err)
}
if pv.Spec.PersistentVolumeSource.Glusterfs != nil && pv.Spec.PersistentVolumeSource.Glusterfs.EndpointsNamespace == nil {
pv.Spec.PersistentVolumeSource.Glusterfs.EndpointsNamespace = &pv.Spec.ClaimRef.Namespace
}
return pv, nil
}

View File

@ -166,8 +166,12 @@ func updatePathForPersistentVolumeSource(persistentVolumeSource *v1.PersistentVo
//glusterfs:
// endpoints: glusterfs-cluster
// path: myVol1
source.Glusterfs.Path = persistentVolumeSource.Glusterfs.Path
source.Glusterfs.Path = newPath(persistentVolumeSource.Glusterfs.Path)
glusterfs := &v1.GlusterfsPersistentVolumeSource{
EndpointsName: persistentVolumeSource.Glusterfs.EndpointsName,
EndpointsNamespace: persistentVolumeSource.Glusterfs.EndpointsNamespace,
Path: newPath(persistentVolumeSource.Glusterfs.Path),
}
source.Glusterfs = glusterfs
default:
return nil, fmt.Errorf("unsupported persistence volume source")
}