provider/consul: catalog entry service id should default to service name

pull/11772/head
Manuwela Kanade 9 years ago
parent bd5a5b0b29
commit 0942aed7a3

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

Loading…
Cancel
Save