From 1f9b3df7b7a7e1a86ffa22233e3b726b56034edc Mon Sep 17 00:00:00 2001 From: Milos Tomic <59831542+tmilos77@users.noreply.github.com> Date: Thu, 14 Nov 2024 15:05:34 +0100 Subject: [PATCH] Update module.go --- internal/module.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/module.go b/internal/module.go index e6c1c51..e1ea238 100644 --- a/internal/module.go +++ b/internal/module.go @@ -128,7 +128,10 @@ func getReloadedKyma(ctx context.Context) (*ResourceDefn, error) { func getKymaModuleIndexInSpec(moduleName string, obj map[string]interface{}) (int, []interface{}, error) { modules, exists, err := unstructured.NestedSlice(obj, "spec", "modules") - if !exists || err != nil { + if !exists { + return -1, []interface{}{}, nil + } + if err != nil { return -1, nil, fmt.Errorf("error reading kyma spec modules: %w", err) }