From a2350c7a4a756d084ea8a94a13a8dd27b0deacf2 Mon Sep 17 00:00:00 2001 From: Ryan Emerson Date: Thu, 24 Aug 2023 15:35:49 +0100 Subject: [PATCH] Return error when Cache CR has no template definition. Resolves #1846 --- controllers/cache_controller.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/controllers/cache_controller.go b/controllers/cache_controller.go index 224ac3895..574c80d38 100644 --- a/controllers/cache_controller.go +++ b/controllers/cache_controller.go @@ -322,8 +322,7 @@ func (r *cacheRequest) reconcileDataGrid(cacheExists bool, cache api.Cache) erro spec := r.cache.Spec if spec.Template == "" && spec.TemplateName == "" { - r.log.Info("ignoring cache as 'spec.template' and 'spec.TemplateName' are undefined") - return nil + return fmt.Errorf("unable to reconcile Cache as both 'spec.template' and 'spec.templateName' are undefined") } if cacheExists {