From ddd70b513da6cc52e45af582a06703e9e9acda50 Mon Sep 17 00:00:00 2001 From: francesco-racciatti Date: Mon, 22 Apr 2024 13:57:56 +0200 Subject: [PATCH] fix(pkg): make sure the config entrypoint/cmd exist before looping over them Signed-off-by: francesco-racciatti --- pkg/kilt/build.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/kilt/build.go b/pkg/kilt/build.go index ab5f31e..81f26cb 100644 --- a/pkg/kilt/build.go +++ b/pkg/kilt/build.go @@ -154,9 +154,9 @@ func applyPatch(container *gabs.Container, config *configuration.Config, patchCo entryPoint := gabs.New() entryPoint.Set(make([]interface{}, 0)) - rawEntryPoint := config.GetValue("build.entry_point").GetArray() + rawEntryPoint := config.GetValue("build.entry_point") if rawEntryPoint != nil { - for _, c := range rawEntryPoint { + for _, c := range rawEntryPoint.GetArray() { entryPoint.ArrayAppend(renderHoconValue(c)) } } @@ -167,9 +167,9 @@ func applyPatch(container *gabs.Container, config *configuration.Config, patchCo command := gabs.New() command.Set(make([]interface{}, 0)) - rawCommand := config.GetValue("build.command").GetArray() + rawCommand := config.GetValue("build.command") if rawCommand != nil { - for _, c := range rawCommand { + for _, c := range rawCommand.GetArray() { command.ArrayAppend(renderHoconValue(c)) } }