diff --git a/cmd/e2e/e2e.go b/cmd/e2e/e2e.go index c8ed3169579..62fcb26412b 100644 --- a/cmd/e2e/e2e.go +++ b/cmd/e2e/e2e.go @@ -75,6 +75,10 @@ func main() { if *provider == "aws" { awsConfig := "[Global]\n" + if *gceZone == "" { + glog.Error("gce_zone must be specified for AWS") + os.Exit(1) + } awsConfig += fmt.Sprintf("Zone=%s\n", *gceZone) var err error diff --git a/pkg/cloudprovider/aws/aws.go b/pkg/cloudprovider/aws/aws.go index dfe75d3d5ad..b5a68b4a91a 100644 --- a/pkg/cloudprovider/aws/aws.go +++ b/pkg/cloudprovider/aws/aws.go @@ -64,7 +64,6 @@ type AWSMetadata interface { type VolumeOptions struct { CapacityMB int - Zone string } // Volumes is an interface for managing cloud-provisioned volumes @@ -241,9 +240,9 @@ func newAWSCloud(config io.Reader, authFunc AuthFunc, instanceId string, metadat ec2 := &goamzEC2{ec2: ec2.New(auth, region)} awsCloud := &AWSCloud{ - ec2: ec2, - cfg: cfg, - region: region, + ec2: ec2, + cfg: cfg, + region: region, availabilityZone: zone, } @@ -894,7 +893,7 @@ func (aws *AWSCloud) DetachDisk(instanceName string, diskName string) error { // Implements Volumes.CreateVolume func (aws *AWSCloud) CreateVolume(volumeOptions *VolumeOptions) (string, error) { request := &ec2.CreateVolume{} - request.AvailZone = volumeOptions.Zone + request.AvailZone = aws.availabilityZone request.Size = (int64(volumeOptions.CapacityMB) + 1023) / 1024 response, err := aws.ec2.CreateVolume(request) if err != nil { diff --git a/test/e2e/pd.go b/test/e2e/pd.go index e2f7def4a58..5d4d4379130 100644 --- a/test/e2e/pd.go +++ b/test/e2e/pd.go @@ -193,7 +193,6 @@ func createPD() (string, error) { } volumeOptions := &aws_cloud.VolumeOptions{} volumeOptions.CapacityMB = 10 * 1024 - volumeOptions.Zone = testContext.cloudConfig.Zone return volumes.CreateVolume(volumeOptions) } else { return "", fmt.Errorf("Unsupported provider type")