Added PersistentVolumeController
This commit is contained in:
@@ -145,7 +145,7 @@ func TestDeleterTempDir(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreater(t *testing.T) {
|
||||
func TestProvisioner(t *testing.T) {
|
||||
tempPath := "/tmp/hostpath/"
|
||||
defer os.RemoveAll(tempPath)
|
||||
err := os.MkdirAll(tempPath, 0750)
|
||||
@@ -157,18 +157,18 @@ func TestCreater(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("Can't find the plugin by name")
|
||||
}
|
||||
creater, err := plug.NewCreater(volume.VolumeOptions{CapacityMB: 100, PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete})
|
||||
creater, err := plug.NewProvisioner(volume.VolumeOptions{Capacity: resource.MustParse("1Gi"), PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete})
|
||||
if err != nil {
|
||||
t.Errorf("Failed to make a new Creater: %v", err)
|
||||
t.Errorf("Failed to make a new Provisioner: %v", err)
|
||||
}
|
||||
pv, err := creater.Create()
|
||||
pv, err := creater.NewPersistentVolumeTemplate()
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error creating volume: %v", err)
|
||||
}
|
||||
if pv.Spec.HostPath.Path == "" {
|
||||
t.Errorf("Expected pv.Spec.HostPath.Path to not be empty: %#v", pv)
|
||||
}
|
||||
expectedCapacity := resource.NewQuantity(100*1024*1024, resource.BinarySI)
|
||||
expectedCapacity := resource.NewQuantity(1*1024*1024*1024, resource.BinarySI)
|
||||
actualCapacity := pv.Spec.Capacity[api.ResourceStorage]
|
||||
expectedAmt := expectedCapacity.Value()
|
||||
actualAmt := actualCapacity.Value()
|
||||
|
Reference in New Issue
Block a user