Merge pull request #9128 from tstromberg/pvc-directory

Add namespace to persistent volume path
pull/9109/head
Thomas Strömberg 2020-08-31 22:34:03 -07:00 committed by GitHub
commit cf7484ed59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}