Browse Source

change provisioner name

pull/2/head
Nicolas Massé 9 years ago
parent
commit
8a95b196be
  1. 4
      setup/class.yaml
  2. 16
      src/hostpath-provisioner/hostpath-provisioner.go

4
setup/class.yaml

@ -1,5 +1,5 @@
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1beta1
metadata: metadata:
name: example-hostpath name: hostpath-provisioner
provisioner: example.com/hostpath provisioner: itix.fr/hostpath

16
src/hostpath-provisioner/hostpath-provisioner.go

@ -35,7 +35,7 @@ import (
const ( const (
resyncPeriod = 15 * time.Second resyncPeriod = 15 * time.Second
provisionerName = "example.com/hostpath" provisionerName = "itix.fr/hostpath"
exponentialBackOffOnError = false exponentialBackOffOnError = false
failedRetryThreshold = 5 failedRetryThreshold = 5
leasePeriod = controller.DefaultLeaseDuration leasePeriod = controller.DefaultLeaseDuration
@ -58,8 +58,12 @@ func NewHostPathProvisioner() controller.Provisioner {
if nodeName == "" { if nodeName == "" {
glog.Fatal("env variable NODE_NAME must be set so that this provisioner can identify itself") glog.Fatal("env variable NODE_NAME must be set so that this provisioner can identify itself")
} }
hostPath := os.Getenv("HOSTPATH_TO_USE")
if hostPath == "" {
glog.Fatal("env variable HOSTPATH_TO_USE must be set")
}
return &hostPathProvisioner{ return &hostPathProvisioner{
pvDir: "/tmp/hostpath-provisioner", pvDir: hostPath,
identity: nodeName, identity: nodeName,
} }
} }
@ -110,9 +114,11 @@ func (p *hostPathProvisioner) Delete(volume *v1.PersistentVolume) error {
} }
path := path.Join(p.pvDir, volume.Name) path := path.Join(p.pvDir, volume.Name)
if err := os.RemoveAll(path); err != nil {
return err // Not for the moment, please !
} //if err := os.RemoveAll(path); err != nil {
// return err
//}
return nil return nil
} }

Loading…
Cancel
Save