From 978f52a9a92835cf19af07f3e402fb30a594c305 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Mon, 27 Jun 2022 17:40:26 +0200 Subject: [PATCH] fixup! Refactor functions in 'pkg/libdevfile/libdevfile.go' --- pkg/devfile/adapters/kubernetes/utils/utils.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/devfile/adapters/kubernetes/utils/utils.go b/pkg/devfile/adapters/kubernetes/utils/utils.go index ebdf8f23afc..56c1c872755 100644 --- a/pkg/devfile/adapters/kubernetes/utils/utils.go +++ b/pkg/devfile/adapters/kubernetes/utils/utils.go @@ -133,14 +133,11 @@ func UpdateContainersEntrypointsIfNeeded( components = append(components, containerComps...) } - if len(components) != 0 { + for _, c := range components { for i := range containers { container := &containers[i] - for _, c := range components { - if container.Name == c { - overrideContainerCommandAndArgsIfNeeded(container) - break - } + if container.Name == c { + overrideContainerCommandAndArgsIfNeeded(container) } } }