rancher_stack: Only read compose when catalog_id is empty (#11593)

This commit is contained in:
Raphaël Pinson 2017-02-01 13:33:23 +01:00 committed by Paul Stack
parent 89acb5811a
commit a3bfc5e8b3

View File

@ -155,8 +155,12 @@ func resourceRancherStackRead(d *schema.ResourceData, meta interface{}) error {
d.Set("name", stack.Name)
dockerCompose := strings.Replace(config.DockerComposeConfig, "\r", "", -1)
rancherCompose := strings.Replace(config.RancherComposeConfig, "\r", "", -1)
d.Set("docker_compose", dockerCompose)
d.Set("rancher_compose", rancherCompose)
catalogId := d.Get("catalog_id")
if catalogId == "" {
d.Set("docker_compose", dockerCompose)
d.Set("rancher_compose", rancherCompose)
}
d.Set("rendered_docker_compose", dockerCompose)
d.Set("rendered_rancher_compose", rancherCompose)
d.Set("environment_id", stack.AccountId)