drop status field from yamls

Signed-off-by: shubhindia <shubhindia123@gmail.com>
This commit is contained in:
shubhindia 2023-10-29 11:53:19 +05:30
parent 7826534666
commit 21d8dc8a81

View File

@ -22,6 +22,7 @@ import (
"os/exec"
"path"
"path/filepath"
"regexp"
"strings"
dockerlib "github.com/fsouza/go-dockerclient"
@ -274,6 +275,10 @@ func ConfigAnnotations(service kobject.ServiceConfig) map[string]string {
// Print either prints to stdout or to file/s
func Print(name, path string, trailing string, data []byte, toStdout, generateJSON bool, f *os.File, provider string) (string, error) {
file := ""
// simple hack to remove status from the output
re := regexp.MustCompile(`(?s)status:.*`)
data = re.ReplaceAll(data, nil)
if generateJSON {
file = fmt.Sprintf("%s-%s.json", name, trailing)
} else {