Merge pull request #11772 from manuwelakanade/master

provider/consul: catalog entry service id should default to service name
This commit is contained in:
Sean Chittenden 2017-02-13 12:28:41 -08:00 committed by GitHub
commit 606ed0747f
1 changed files with 3 additions and 0 deletions

View File

@ -147,6 +147,9 @@ func resourceConsulCatalogEntryCreate(d *schema.ResourceData, meta interface{})
for i, rawService := range serviceList { for i, rawService := range serviceList {
serviceData := rawService.(map[string]interface{}) serviceData := rawService.(map[string]interface{})
if len(serviceData["id"].(string)) == 0 {
serviceData["id"] = serviceData["name"].(string)
}
serviceID := serviceData["id"].(string) serviceID := serviceData["id"].(string)
serviceIDs[i] = serviceID serviceIDs[i] = serviceID