Merge pull request #33568 from justinsb/fix_33563

Automatic merge from submit-queue

AWS: Support default value for ExternalHost
This commit is contained in:
Kubernetes Submit Queue 2016-11-08 05:07:13 -08:00 committed by GitHub
commit 4dbc532c9a

View File

@ -493,14 +493,14 @@ func DefaultAndValidateRunOptions(options *options.ServerRunOptions) {
// Set default value for ExternalAddress if not specified. // Set default value for ExternalAddress if not specified.
if len(options.ExternalHost) == 0 { if len(options.ExternalHost) == 0 {
// TODO: extend for other providers // TODO: extend for other providers
if options.CloudProvider == "gce" { if options.CloudProvider == "gce" || options.CloudProvider == "aws" {
cloud, err := cloudprovider.InitCloudProvider(options.CloudProvider, options.CloudConfigFile) cloud, err := cloudprovider.InitCloudProvider(options.CloudProvider, options.CloudConfigFile)
if err != nil { if err != nil {
glog.Fatalf("Cloud provider could not be initialized: %v", err) glog.Fatalf("Cloud provider could not be initialized: %v", err)
} }
instances, supported := cloud.Instances() instances, supported := cloud.Instances()
if !supported { if !supported {
glog.Fatalf("GCE cloud provider has no instances. this shouldn't happen. exiting.") glog.Fatalf("%q cloud provider has no instances. this shouldn't happen. exiting.", options.CloudProvider)
} }
hostname, err := os.Hostname() hostname, err := os.Hostname()
if err != nil { if err != nil {