AWS e2e: don't try to build a full cloudprovider in e2e

We have previously tried building a full cloudprovider in e2e for AWS;
this wasn't the best idea, because e2e runs on a different machine than
normal operations, and often doesn't even run in AWS.  In turn, this
meant that the cloudprovider had to do extra work and have extra code,
which we would like to get rid of.  Indeed, I got rid of some code which
tolerated not running in AWS, and this broke e2e.
This commit is contained in:
Justin Santa Barbara
2016-03-12 05:57:59 -05:00
parent 0787b313eb
commit 3e12e8b7cc
4 changed files with 84 additions and 59 deletions

View File

@@ -21,7 +21,6 @@ import (
"fmt"
"os"
"path"
"strings"
"sync"
"testing"
"time"
@@ -36,7 +35,6 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
"k8s.io/kubernetes/pkg/cloudprovider"
gcecloud "k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/runtime"
@@ -125,22 +123,9 @@ func setupProviderConfig() error {
}
case "aws":
awsConfig := "[Global]\n"
if cloudConfig.Zone == "" {
return fmt.Errorf("gce-zone must be specified for AWS")
}
awsConfig += fmt.Sprintf("Zone=%s\n", cloudConfig.Zone)
if cloudConfig.ClusterTag == "" {
return fmt.Errorf("--cluster-tag must be specified for AWS")
}
awsConfig += fmt.Sprintf("KubernetesClusterTag=%s\n", cloudConfig.ClusterTag)
var err error
cloudConfig.Provider, err = cloudprovider.GetCloudProvider(testContext.Provider, strings.NewReader(awsConfig))
if err != nil {
return fmt.Errorf("Error building AWS provider: %v", err)
}
}