mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
parent
3e3ff447d2
commit
2c7771e90c
@ -503,14 +503,14 @@ func DefaultAndValidateRunOptions(options *options.ServerRunOptions) {
|
|||||||
// Set default value for ExternalHost if not specified.
|
// Set default value for ExternalHost 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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user