Add namespace to persistent volume path

pull/9128/head
Thomas Stromberg 2020-08-30 22:27:04 -07:00
parent a8b40a704b
commit c152570f6c
1 changed files with 2 additions and 2 deletions

View File

@ -56,8 +56,8 @@ var _ controller.Provisioner = &hostPathProvisioner{}
// Provision creates a storage asset and returns a PV object representing it.
func (p *hostPathProvisioner) Provision(options controller.ProvisionOptions) (*core.PersistentVolume, error) {
glog.Infof("Provisioning volume %v", options)
path := path.Join(p.pvDir, options.PVC.Name)
path := path.Join(p.pvDir, options.PVC.Namespace, options.PVC.Name)
glog.Infof("Provisioning volume %v to %s", options, path)
if err := os.MkdirAll(path, 0777); err != nil {
return nil, err
}