@@ -1503,17 +1503,18 @@ func (v *azureVolume) DeleteVolume() {
1503
1503
1504
1504
// AWS
1505
1505
type awsDriver struct {
1506
- volumeName string
1507
-
1508
1506
driverInfo testsuites.DriverInfo
1509
1507
}
1510
1508
1509
+ type awsVolume struct {
1510
+ volumeName string
1511
+ }
1512
+
1511
1513
var _ testsuites.TestDriver = & awsDriver {}
1512
1514
1513
- // TODO: Fix authorization error in attach operation and uncomment below
1514
- //var _ testsuites.PreprovisionedVolumeTestDriver = &awsDriver{}
1515
- //var _ testsuites.InlineVolumeTestDriver = &awsDriver{}
1516
- //var _ testsuites.PreprovisionedPVTestDriver = &awsDriver{}
1515
+ var _ testsuites.PreprovisionedVolumeTestDriver = & awsDriver {}
1516
+ var _ testsuites.InlineVolumeTestDriver = & awsDriver {}
1517
+ var _ testsuites.PreprovisionedPVTestDriver = & awsDriver {}
1517
1518
var _ testsuites.DynamicPVTestDriver = & awsDriver {}
1518
1519
1519
1520
// InitAwsDriver returns awsDriver that implements TestDriver interface
@@ -1525,7 +1526,10 @@ func InitAwsDriver() testsuites.TestDriver {
1525
1526
MaxFileSize : testpatterns .FileSizeMedium ,
1526
1527
SupportedFsType : sets .NewString (
1527
1528
"" , // Default fsType
1529
+ "ext2" ,
1528
1530
"ext3" ,
1531
+ "ext4" ,
1532
+ "xfs" ,
1529
1533
"ntfs" ,
1530
1534
),
1531
1535
SupportedMountOption : sets .NewString ("debug" , "nouid32" ),
@@ -1550,12 +1554,12 @@ func (a *awsDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
1550
1554
framework .SkipUnlessProviderIs ("aws" )
1551
1555
}
1552
1556
1553
- // TODO: Fix authorization error in attach operation and uncomment below
1554
- /*
1555
1557
func (a * awsDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
1558
+ av , ok := volume .(* awsVolume )
1559
+ gomega .Expect (ok ).To (gomega .BeTrue (), "Failed to cast test volume to AWS test volume" )
1556
1560
volSource := v1.VolumeSource {
1557
1561
AWSElasticBlockStore : & v1.AWSElasticBlockStoreVolumeSource {
1558
- VolumeID: a .volumeName,
1562
+ VolumeID : av .volumeName ,
1559
1563
ReadOnly : readOnly ,
1560
1564
},
1561
1565
}
@@ -1566,18 +1570,19 @@ func (a *awsDriver) GetVolumeSource(readOnly bool, fsType string, volume testsui
1566
1570
}
1567
1571
1568
1572
func (a * awsDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
1573
+ av , ok := volume .(* awsVolume )
1574
+ gomega .Expect (ok ).To (gomega .BeTrue (), "Failed to cast test volume to AWS test volume" )
1569
1575
pvSource := v1.PersistentVolumeSource {
1570
1576
AWSElasticBlockStore : & v1.AWSElasticBlockStoreVolumeSource {
1571
- VolumeID: a .volumeName,
1577
+ VolumeID : av .volumeName ,
1572
1578
ReadOnly : readOnly ,
1573
1579
},
1574
1580
}
1575
1581
if fsType != "" {
1576
1582
pvSource .AWSElasticBlockStore .FSType = fsType
1577
1583
}
1578
- return &pvSource
1584
+ return & pvSource , nil
1579
1585
}
1580
- */
1581
1586
1582
1587
func (a * awsDriver ) GetDynamicProvisionStorageClass (config * testsuites.PerTestConfig , fsType string ) * storagev1.StorageClass {
1583
1588
provisioner := "kubernetes.io/aws-ebs"
@@ -1587,8 +1592,9 @@ func (a *awsDriver) GetDynamicProvisionStorageClass(config *testsuites.PerTestCo
1587
1592
}
1588
1593
ns := config .Framework .Namespace .Name
1589
1594
suffix := fmt .Sprintf ("%s-sc" , a .driverInfo .Name )
1595
+ delayedBinding := storagev1 .VolumeBindingWaitForFirstConsumer
1590
1596
1591
- return testsuites .GetStorageClass (provisioner , parameters , nil , ns , suffix )
1597
+ return testsuites .GetStorageClass (provisioner , parameters , & delayedBinding , ns , suffix )
1592
1598
}
1593
1599
1594
1600
func (a * awsDriver ) GetClaimSize () string {
@@ -1609,19 +1615,25 @@ func (a *awsDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTestConf
1609
1615
return config , func () {}
1610
1616
}
1611
1617
1612
- // TODO: Fix authorization error in attach operation and uncomment below
1613
- /*
1614
1618
func (a * awsDriver ) CreateVolume (config * testsuites.PerTestConfig , volType testpatterns.TestVolType ) testsuites.TestVolume {
1619
+ if volType == testpatterns .InlineVolume {
1620
+ // PD will be created in framework.TestContext.CloudConfig.Zone zone,
1621
+ // so pods should be also scheduled there.
1622
+ config .ClientNodeSelector = map [string ]string {
1623
+ v1 .LabelZoneFailureDomain : framework .TestContext .CloudConfig .Zone ,
1624
+ }
1625
+ }
1615
1626
ginkgo .By ("creating a test aws volume" )
1616
- var err error
1617
- a.volumeName, err = framework.CreatePDWithRetry()
1618
- framework.ExpectNoError(err))
1627
+ vname , err := framework .CreatePDWithRetry ()
1628
+ framework .ExpectNoError (err )
1629
+ return & awsVolume {
1630
+ volumeName : vname ,
1631
+ }
1619
1632
}
1620
1633
1621
- DeleteVolume() {
1622
- framework.DeletePDWithRetry(a .volumeName)
1634
+ func ( v * awsVolume ) DeleteVolume () {
1635
+ framework .DeletePDWithRetry (v .volumeName )
1623
1636
}
1624
- */
1625
1637
1626
1638
// local
1627
1639
type localDriver struct {
0 commit comments