Commit 2c7771e9 authored by Justin Santa Barbara's avatar Justin Santa Barbara

AWS: Support default for ExternalHost on AWS

Fix #33563
parent 3e3ff447
......@@ -503,14 +503,14 @@ func DefaultAndValidateRunOptions(options *options.ServerRunOptions) {
// Set default value for ExternalHost if not specified.
if len(options.ExternalHost) == 0 {
// TODO: extend for other providers
if options.CloudProvider == "gce" {
if options.CloudProvider == "gce" || options.CloudProvider == "aws" {
cloud, err := cloudprovider.InitCloudProvider(options.CloudProvider, options.CloudConfigFile)
if err != nil {
glog.Fatalf("Cloud provider could not be initialized: %v", err)
}
instances, supported := cloud.Instances()
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()
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment