@@ -1512,17 +1512,18 @@ func (v *azureVolume) DeleteVolume() {
1512
1512
1513
1513
// AWS
1514
1514
type awsDriver struct {
1515
- volumeName string
1516
-
1517
1515
driverInfo testsuites.DriverInfo
1518
1516
}
1519
1517
1518
+ type awsVolume struct {
1519
+ volumeName string
1520
+ }
1521
+
1520
1522
var _ testsuites.TestDriver = & awsDriver {}
1521
1523
1522
- // TODO: Fix authorization error in attach operation and uncomment below
1523
- //var _ testsuites.PreprovisionedVolumeTestDriver = &awsDriver{}
1524
- //var _ testsuites.InlineVolumeTestDriver = &awsDriver{}
1525
- //var _ testsuites.PreprovisionedPVTestDriver = &awsDriver{}
1524
+ var _ testsuites.PreprovisionedVolumeTestDriver = & awsDriver {}
1525
+ var _ testsuites.InlineVolumeTestDriver = & awsDriver {}
1526
+ var _ testsuites.PreprovisionedPVTestDriver = & awsDriver {}
1526
1527
var _ testsuites.DynamicPVTestDriver = & awsDriver {}
1527
1528
1528
1529
// InitAwsDriver returns awsDriver that implements TestDriver interface
@@ -1534,7 +1535,10 @@ func InitAwsDriver() testsuites.TestDriver {
1534
1535
MaxFileSize : testpatterns .FileSizeMedium ,
1535
1536
SupportedFsType : sets .NewString (
1536
1537
"" , // Default fsType
1538
+ "ext2" ,
1537
1539
"ext3" ,
1540
+ "ext4" ,
1541
+ "xfs" ,
1538
1542
"ntfs" ,
1539
1543
),
1540
1544
SupportedMountOption : sets .NewString ("debug" , "nouid32" ),
@@ -1562,12 +1566,12 @@ func (a *awsDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
1562
1566
framework .SkipUnlessProviderIs ("aws" )
1563
1567
}
1564
1568
1565
- // TODO: Fix authorization error in attach operation and uncomment below
1566
- /*
1567
1569
func (a * awsDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
1570
+ av , ok := volume .(* awsVolume )
1571
+ gomega .Expect (ok ).To (gomega .BeTrue (), "Failed to cast test volume to AWS test volume" )
1568
1572
volSource := v1.VolumeSource {
1569
1573
AWSElasticBlockStore : & v1.AWSElasticBlockStoreVolumeSource {
1570
- VolumeID: a .volumeName,
1574
+ VolumeID : av .volumeName ,
1571
1575
ReadOnly : readOnly ,
1572
1576
},
1573
1577
}
@@ -1578,18 +1582,19 @@ func (a *awsDriver) GetVolumeSource(readOnly bool, fsType string, volume testsui
1578
1582
}
1579
1583
1580
1584
func (a * awsDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
1585
+ av , ok := volume .(* awsVolume )
1586
+ gomega .Expect (ok ).To (gomega .BeTrue (), "Failed to cast test volume to AWS test volume" )
1581
1587
pvSource := v1.PersistentVolumeSource {
1582
1588
AWSElasticBlockStore : & v1.AWSElasticBlockStoreVolumeSource {
1583
- VolumeID: a .volumeName,
1589
+ VolumeID : av .volumeName ,
1584
1590
ReadOnly : readOnly ,
1585
1591
},
1586
1592
}
1587
1593
if fsType != "" {
1588
1594
pvSource .AWSElasticBlockStore .FSType = fsType
1589
1595
}
1590
- return &pvSource
1596
+ return & pvSource , nil
1591
1597
}
1592
- */
1593
1598
1594
1599
func (a * awsDriver ) GetDynamicProvisionStorageClass (config * testsuites.PerTestConfig , fsType string ) * storagev1.StorageClass {
1595
1600
provisioner := "kubernetes.io/aws-ebs"
@@ -1599,8 +1604,9 @@ func (a *awsDriver) GetDynamicProvisionStorageClass(config *testsuites.PerTestCo
1599
1604
}
1600
1605
ns := config .Framework .Namespace .Name
1601
1606
suffix := fmt .Sprintf ("%s-sc" , a .driverInfo .Name )
1607
+ delayedBinding := storagev1 .VolumeBindingWaitForFirstConsumer
1602
1608
1603
- return testsuites .GetStorageClass (provisioner , parameters , nil , ns , suffix )
1609
+ return testsuites .GetStorageClass (provisioner , parameters , & delayedBinding , ns , suffix )
1604
1610
}
1605
1611
1606
1612
func (a * awsDriver ) GetClaimSize () string {
@@ -1621,19 +1627,25 @@ func (a *awsDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTestConf
1621
1627
return config , func () {}
1622
1628
}
1623
1629
1624
- // TODO: Fix authorization error in attach operation and uncomment below
1625
- /*
1626
1630
func (a * awsDriver ) CreateVolume (config * testsuites.PerTestConfig , volType testpatterns.TestVolType ) testsuites.TestVolume {
1631
+ if volType == testpatterns .InlineVolume {
1632
+ // PD will be created in framework.TestContext.CloudConfig.Zone zone,
1633
+ // so pods should be also scheduled there.
1634
+ config .ClientNodeSelector = map [string ]string {
1635
+ v1 .LabelZoneFailureDomain : framework .TestContext .CloudConfig .Zone ,
1636
+ }
1637
+ }
1627
1638
ginkgo .By ("creating a test aws volume" )
1628
- var err error
1629
- a.volumeName, err = framework.CreatePDWithRetry()
1630
- framework.ExpectNoError(err))
1639
+ vname , err := framework .CreatePDWithRetry ()
1640
+ framework .ExpectNoError (err )
1641
+ return & awsVolume {
1642
+ volumeName : vname ,
1643
+ }
1631
1644
}
1632
1645
1633
- DeleteVolume() {
1634
- framework.DeletePDWithRetry(a .volumeName)
1646
+ func ( v * awsVolume ) DeleteVolume () {
1647
+ framework .DeletePDWithRetry (v .volumeName )
1635
1648
}
1636
- */
1637
1649
1638
1650
// local
1639
1651
type localDriver struct {
0 commit comments