Skip to content

Commit

Permalink
remove status field from generated yaml
Browse files Browse the repository at this point in the history
Signed-off-by: shubhindia <shubhindia123@gmail.com>
  • Loading branch information
shubhindia committed Oct 17, 2023
1 parent 1f4b069 commit d2f06f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/transformer/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"os/exec"
"path"
"path/filepath"
"regexp"
"strings"

dockerlib "github.com/fsouza/go-dockerclient"
Expand Down Expand Up @@ -291,6 +292,11 @@ func Print(name, path string, trailing string, data []byte, toStdout, generateJS
} else {
// Write content separately to each file
file = filepath.Join(path, file)

// simple hack to remove status from the output
re := regexp.MustCompile(`status:[\s\S]*?(?:---|$)`)
data = re.ReplaceAll(data, nil)

if err := os.WriteFile(file, data, 0644); err != nil {
return "", errors.Wrap(err, "Failed to write %s: "+trailing)
}
Expand Down

0 comments on commit d2f06f9

Please sign in to comment.