Skip to content

Commit

Permalink
Revert "Create local volumes instead of hostPath"
Browse files Browse the repository at this point in the history
This reverts commit fb27d14.

Local volumes breaks provisioner on RKE.

Revert: #91
  • Loading branch information
yasker committed Aug 10, 2020
1 parent 737d3e3 commit df53c25
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func (p *LocalPathProvisioner) Provision(opts pvController.ProvisionOptions) (*v
}

fs := v1.PersistentVolumeFilesystem
hostPathType := v1.HostPathDirectoryOrCreate
return &v1.PersistentVolume{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Expand All @@ -210,8 +211,9 @@ func (p *LocalPathProvisioner) Provision(opts pvController.ProvisionOptions) (*v
v1.ResourceName(v1.ResourceStorage): pvc.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)],
},
PersistentVolumeSource: v1.PersistentVolumeSource{
Local: &v1.LocalVolumeSource{
HostPath: &v1.HostPathVolumeSource{
Path: path,
Type: &hostPathType,
},
},
NodeAffinity: &v1.VolumeNodeAffinity{
Expand Down Expand Up @@ -261,11 +263,11 @@ func (p *LocalPathProvisioner) getPathAndNodeForPV(pv *v1.PersistentVolume) (pat
err = errors.Wrapf(err, "failed to delete volume %v", pv.Name)
}()

local := pv.Spec.PersistentVolumeSource.Local
if local == nil {
return "", "", fmt.Errorf("no Local set")
hostPath := pv.Spec.PersistentVolumeSource.HostPath
if hostPath == nil {
return "", "", fmt.Errorf("no HostPath set")
}
path = local.Path
path = hostPath.Path

nodeAffinity := pv.Spec.NodeAffinity
if nodeAffinity == nil {
Expand Down

0 comments on commit df53c25

Please sign in to comment.