Pass whole PVC to provisioner plugin

Gluster provisioner is interested in pvc.Namespace and I don't want to add
at as a new field in VolumeOptions - it would contain almost whole PVC.

Let's pass direct reference to PVC instead and let the provisioner to pick
information it is interested in.
This commit is contained in:
Jan Safranek
2016-10-12 12:22:01 +02:00
parent 4747e1cc1d
commit 101602ab11
28 changed files with 135 additions and 133 deletions

View File

@@ -161,7 +161,11 @@ func TestProvisioner(t *testing.T) {
if err != nil {
t.Errorf("Can't find the plugin by name")
}
creater, err := plug.NewProvisioner(volume.VolumeOptions{Capacity: resource.MustParse("1Gi"), PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete})
options := volume.VolumeOptions{
PVC: volumetest.CreateTestPVC("1Gi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}),
PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete,
}
creater, err := plug.NewProvisioner(options)
if err != nil {
t.Errorf("Failed to make a new Provisioner: %v", err)
}