Exit from NewController() for PersistentVolumeController when InitPlugins() failed just like NewAttachDetachController() does

This commit is contained in:
NickrenREN
2017-03-13 15:41:59 +08:00
parent ceccd305ce
commit e0ef5bfd40
6 changed files with 38 additions and 15 deletions

View File

@@ -391,7 +391,10 @@ func TestProvisionMultiSync(t *testing.T) {
// When provisioning is disabled, provisioning a claim should instantly return nil
func TestDisablingDynamicProvisioner(t *testing.T) {
ctrl := newTestController(nil, nil, false)
ctrl, err := newTestController(nil, nil, false)
if err != nil {
t.Fatalf("Construct PersistentVolume controller failed: %v", err)
}
retVal := ctrl.provisionClaim(nil)
if retVal != nil {
t.Errorf("Expected nil return but got %v", retVal)