fix sqs url for china

This commit is contained in:
Jason Haugen 2021-04-09 13:15:56 -05:00
parent cceb9dd296
commit a2cc750d62
1 changed files with 5 additions and 1 deletions

View File

@ -220,7 +220,11 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
if cluster.Spec.NodeTerminationHandler != nil {
dest["DefaultQueueName"] = func() string {
s := strings.Replace(tf.ClusterName(), ".", "-", -1)
url := "https://sqs." + tf.Region + ".amazonaws.com/" + tf.AWSAccountID + "/" + s + "-nth"
domain := ".amazonaws.com/"
if strings.Contains(tf.Region, "cn-") {
domain = ".amazonaws.com.cn/"
}
url := "https://sqs." + tf.Region + domain + tf.AWSAccountID + "/" + s + "-nth"
return url
}
}