...
1 package reproducer
2
3 import (
4 "bytes"
5 "fmt"
6
7 "github.com/emissary-ingress/emissary/v3/pkg/kates"
8 "github.com/pkg/errors"
9 "sigs.k8s.io/yaml"
10 )
11
12 func marshalManifests(manifests []*kates.Unstructured) ([]byte, error) {
13 result := bytes.NewBuffer(nil)
14
15 pfx := ""
16 for _, p := range manifests {
17 marshalled, err := yaml.Marshal(p)
18 if err != nil {
19 return nil, errors.Wrapf(err, "marshalling processed")
20 }
21 result.WriteString(fmt.Sprintf("%s---\n%s", pfx, string(marshalled)))
22 pfx = "\n"
23 }
24
25 return result.Bytes(), nil
26 }
27
View as plain text