Skip to content

Commit

Permalink
fix issue in kubectl prepare resources
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Apr 1, 2020
1 parent 93a67c1 commit 57a4c02
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/devspace/deploy/deployer/kubectl/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 57a4c02

Please sign in to comment.