Override hostname with '@aws' only if hostname override is not specified.

This commit is contained in:
Tomas Virgl 2018-06-06 13:54:19 -07:00
parent b552743d69
commit 874e2a514f
1 changed files with 4 additions and 1 deletions

View File

@ -69,7 +69,10 @@ func (b *KubeProxyOptionsBuilder) BuildOptions(o interface{}) error {
cloudProvider := kops.CloudProviderID(clusterSpec.CloudProvider)
if cloudProvider == kops.CloudProviderAWS {
// Use the hostname from the AWS metadata service
config.HostnameOverride = "@aws"
// if hostnameOverride is not set.
if config.HostnameOverride == "" {
config.HostnameOverride = "@aws"
}
}
return nil