Update e2e tests to use beta provisioning.

GKE has not the new API and can't use PVC.Spec.StorageClassName attribute.
This commit is contained in:
Jan Safranek 2017-03-01 19:24:10 +01:00
parent 9487552e41
commit c57b246fba

View File

@ -103,13 +103,15 @@ var _ = framework.KubeDescribe("Dynamic provisioning", func() {
ns = f.Namespace.Name ns = f.Namespace.Name
}) })
/*
TODO: enable when GKE is updated with the new API
framework.KubeDescribe("DynamicProvisioner", func() { framework.KubeDescribe("DynamicProvisioner", func() {
It("should create and delete persistent volumes [Slow] [Volume]", func() { It("should create and delete persistent volumes [Slow] [Volume]", func() {
framework.SkipUnlessProviderIs("openstack", "gce", "aws", "gke", "vsphere") framework.SkipUnlessProviderIs("openstack", "gce", "aws", "gke", "vsphere")
By("creating a StorageClass") By("creating a StorageClass")
class := newStorageClass("", "internal") class := newStorageClass("", "internal")
_, err := c.StorageV1beta1().StorageClasses().Create(class) class, err := c.StorageV1beta1().StorageClasses().Create(class)
defer c.StorageV1beta1().StorageClasses().Delete(class.Name, nil) defer c.StorageV1beta1().StorageClasses().Delete(class.Name, nil)
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
@ -134,7 +136,7 @@ var _ = framework.KubeDescribe("Dynamic provisioning", func() {
} }
}) })
}) })
*/
framework.KubeDescribe("DynamicProvisioner Beta", func() { framework.KubeDescribe("DynamicProvisioner Beta", func() {
It("should create and delete persistent volumes [Slow] [Volume]", func() { It("should create and delete persistent volumes [Slow] [Volume]", func() {
framework.SkipUnlessProviderIs("openstack", "gce", "aws", "gke") framework.SkipUnlessProviderIs("openstack", "gce", "aws", "gke")
@ -202,8 +204,11 @@ var _ = framework.KubeDescribe("Dynamic provisioning", func() {
By("Creating a claim and expecting it to timeout") By("Creating a claim and expecting it to timeout")
pvc := newClaim(ns) pvc := newClaim(ns)
className := sc.Name // TODO: switch to attribute when GKE is updated
pvc.Spec.StorageClassName = &className pvc.Annotations = map[string]string{
v1.BetaStorageClassAnnotation: sc.Name,
}
//pvc.Spec.StorageClassName = &className
pvc, err = c.Core().PersistentVolumeClaims(ns).Create(pvc) pvc, err = c.Core().PersistentVolumeClaims(ns).Create(pvc)
defer Expect(c.Core().PersistentVolumeClaims(ns).Delete(pvc.Name, nil)).To(Succeed()) defer Expect(c.Core().PersistentVolumeClaims(ns).Delete(pvc.Name, nil)).To(Succeed())
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
@ -262,7 +267,9 @@ var _ = framework.KubeDescribe("Dynamic provisioning", func() {
By("creating a claim with a dynamic provisioning annotation") By("creating a claim with a dynamic provisioning annotation")
claim := newClaim(ns) claim := newClaim(ns)
className := class.Name className := class.Name
claim.Spec.StorageClassName = &className // TODO: switch to attribute when GKE is updated
claim.Annotations = map[string]string{v1.BetaStorageClassAnnotation: className}
//claim.Spec.StorageClassName = &className
defer func() { defer func() {
c.Core().PersistentVolumeClaims(ns).Delete(claim.Name, nil) c.Core().PersistentVolumeClaims(ns).Delete(claim.Name, nil)
}() }()