Merge pull request #66040 from wongma7/attachflag

Automatic merge from submit-queue (batch tested with PRs 66064, 66040). 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>.

Re-enable write-read pv check in volume provisioning tests

**What this PR does / why we need it**: Except for the recently-added CSI tests, every test that uses testDynamicProvisioning in volume_provisioning has been skipping the 
		`By("checking the created volume is writable and has the PV's mount options")`
and
		`By("checking the created volume is readable and retains data")`
steps due to an unintentional change in https://github.com/kubernetes/kubernetes/pull/59879

**Special notes for your reviewer**: The 'attach' variable name is not descriptive at all, default behaviour is unclear. Tests will take longer of course, but that was always the intention, to not only test provisioning of PV is according to PVC but that you can actually r/w it (hence e2e).

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-07-12 01:34:27 -07:00 committed by GitHub
commit bc98f7a5f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 23 deletions

View File

@ -132,7 +132,6 @@ func (h *hostpathCSIDriver) createStorageClassTest(node v1.Node) storageClassTes
claimSize: "1Gi",
expectedSize: "1Gi",
nodeName: node.Name,
attach: true,
}
}
@ -198,7 +197,6 @@ func (g *gcePDCSIDriver) createStorageClassTest(node v1.Node) storageClassTest {
claimSize: "5Gi",
expectedSize: "5Gi",
nodeName: node.Name,
attach: true,
}
}

View File

@ -48,16 +48,16 @@ import (
)
type storageClassTest struct {
name string
cloudProviders []string
provisioner string
parameters map[string]string
claimSize string
expectedSize string
pvCheck func(volume *v1.PersistentVolume) error
nodeName string
attach bool
volumeMode *v1.PersistentVolumeMode
name string
cloudProviders []string
provisioner string
parameters map[string]string
claimSize string
expectedSize string
pvCheck func(volume *v1.PersistentVolume) error
nodeName string
skipWriteReadCheck bool
volumeMode *v1.PersistentVolumeMode
}
const (
@ -132,7 +132,7 @@ func testDynamicProvisioning(t storageClassTest, client clientset.Interface, cla
Expect(err).NotTo(HaveOccurred())
}
if t.attach {
if !t.skipWriteReadCheck {
// We start two pods:
// - The first writes 'hello word' to the /mnt/test (= the volume).
// - The second one runs grep 'hello world' on /mnt/test.
@ -796,12 +796,12 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
serverUrl := "https://" + pod.Status.PodIP + ":8081"
By("creating a StorageClass")
test := storageClassTest{
name: "Gluster Dynamic provisioner test",
provisioner: "kubernetes.io/glusterfs",
claimSize: "2Gi",
expectedSize: "2Gi",
parameters: map[string]string{"resturl": serverUrl},
attach: false,
name: "Gluster Dynamic provisioner test",
provisioner: "kubernetes.io/glusterfs",
claimSize: "2Gi",
expectedSize: "2Gi",
parameters: map[string]string{"resturl": serverUrl},
skipWriteReadCheck: true,
}
// GCE/GKE
@ -833,10 +833,11 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
By("creating a claim with default class")
block := v1.PersistentVolumeBlock
test := storageClassTest{
name: "default",
claimSize: "2Gi",
expectedSize: "2Gi",
volumeMode: &block,
name: "default",
claimSize: "2Gi",
expectedSize: "2Gi",
volumeMode: &block,
skipWriteReadCheck: true,
}
// gce or gke
if getDefaultPluginName() == "kubernetes.io/gce-pd" {