From 57a4c022b37858baf73a5a94d6997888c1608d34 Mon Sep 17 00:00:00 2001 From: fabiankramm Date: Wed, 1 Apr 2020 12:16:03 +0200 Subject: [PATCH] fix issue in kubectl prepare resources --- pkg/devspace/deploy/deployer/kubectl/builder.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pkg/devspace/deploy/deployer/kubectl/builder.go b/pkg/devspace/deploy/deployer/kubectl/builder.go index 187bfcc88b..c861a9aa0c 100644 --- a/pkg/devspace/deploy/deployer/kubectl/builder.go +++ b/pkg/devspace/deploy/deployer/kubectl/builder.go @@ -102,19 +102,15 @@ var diffSeparator = regexp.MustCompile(`\n---`) var oldDiffSeparator = regexp.MustCompile(`\napiVersion`) func prepareResources(out string) string { - retStr := "" parts := diffSeparator.Split(out, -1) - for _, part := range parts { + for i, part := range parts { oldParts := oldDiffSeparator.Split(part, -1) if len(oldParts) > 1 { - retStr += strings.Join(oldParts, "\n---\napiVersion") - } else { - retStr += part + parts[i] = strings.Join(oldParts, "\n---\napiVersion") } } - - return retStr + return strings.Join(parts, "\n---") } // stringToUnstructuredArray splits a YAML file into unstructured objects. Returns a list of all unstructured objects