Rancher: proper error when catalog template is unknown (#11544)

This commit is contained in:
Raphaël Pinson 2017-01-31 14:04:24 +01:00 committed by Paul Stack
parent 512b155f64
commit 001ee8c1af
1 changed files with 4 additions and 0 deletions

View File

@ -365,6 +365,10 @@ func makeStackData(d *schema.ResourceData, meta interface{}) (data map[string]in
return data, fmt.Errorf("Failed to get catalog template: %s", err) return data, fmt.Errorf("Failed to get catalog template: %s", err)
} }
if template == nil {
return data, fmt.Errorf("Unknown catalog template %s", catalogID)
}
dockerCompose = template.Files["docker-compose.yml"].(string) dockerCompose = template.Files["docker-compose.yml"].(string)
rancherCompose = template.Files["rancher-compose.yml"].(string) rancherCompose = template.Files["rancher-compose.yml"].(string)
} }