Skip to content

Commit

Permalink
Merge pull request kubernetes#52819 from verult/provisioner-e2e-fix
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 48406, 52819). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Fixed nil dereference in dynamic provisioning e2e tests

**What this PR does / why we need it**: Fixed nil dereference in dynamic provisioning e2e tests.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes kubernetes#52815

**Release note**:

```release-note-none
NONE
```
/sig storage
/assign @saad-ali 
/cc @wongma7 
/release-note-none
  • Loading branch information
Kubernetes Submit Queue authored Sep 21, 2017
2 parents 1a8bf2d + fbeb07a commit 939ae0a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/e2e/storage/volume_provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ func testDynamicProvisioning(t storageClassTest, client clientset.Interface, cla

// Check PV properties
By("checking the PV")
Expect(pv.Spec.PersistentVolumeReclaimPolicy).To(Equal(*class.ReclaimPolicy))
expectedAccessModes := []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}
Expect(pv.Spec.AccessModes).To(Equal(expectedAccessModes))
Expect(pv.Spec.ClaimRef.Name).To(Equal(claim.ObjectMeta.Name))
Expect(pv.Spec.ClaimRef.Namespace).To(Equal(claim.ObjectMeta.Namespace))
Expect(pv.Spec.MountOptions).To(Equal(class.MountOptions))
if class == nil {
Expect(pv.Spec.PersistentVolumeReclaimPolicy).To(Equal(v1.PersistentVolumeReclaimDelete))
} else {
Expect(pv.Spec.PersistentVolumeReclaimPolicy).To(Equal(*class.ReclaimPolicy))
Expect(pv.Spec.MountOptions).To(Equal(class.MountOptions))
}

// Run the checker
if t.pvCheck != nil {
Expand Down

0 comments on commit 939ae0a

Please sign in to comment.