From 001ee8c1af02ee09a9ad6d2a01e016363c46c76a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= Date: Tue, 31 Jan 2017 14:04:24 +0100 Subject: [PATCH] Rancher: proper error when catalog template is unknown (#11544) --- builtin/providers/rancher/resource_rancher_stack.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/providers/rancher/resource_rancher_stack.go b/builtin/providers/rancher/resource_rancher_stack.go index ccdb4c059..3bbab20e7 100644 --- a/builtin/providers/rancher/resource_rancher_stack.go +++ b/builtin/providers/rancher/resource_rancher_stack.go @@ -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) } + if template == nil { + return data, fmt.Errorf("Unknown catalog template %s", catalogID) + } + dockerCompose = template.Files["docker-compose.yml"].(string) rancherCompose = template.Files["rancher-compose.yml"].(string) }