We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 919e064 + 1177fcd commit 46a80beCopy full SHA for 46a80be
operator/scripts/utils/yaml.go
@@ -66,11 +66,16 @@ func SplitYAML(yamlBytes []byte) ([][]byte, error) {
66
r := bytes.NewReader(yamlBytes)
67
dec := goyaml.NewDecoder(r)
68
results := make([][]byte, 0)
69
- var value map[string]interface{}
70
- for eof := dec.Decode(&value); errors.Is(eof, io.EOF); eof = dec.Decode(&value) {
71
- if eof != nil {
72
- return nil, eof
+ for {
+ var value map[string]interface{}
+ err := dec.Decode(&value)
+ if err != nil {
73
+ if errors.Is(err, io.EOF) {
74
+ break
75
+ }
76
+ return nil, fmt.Errorf("error decoding yaml: %w", err)
77
}
78
+
79
bytes, err := goyaml.Marshal(value)
80
if err != nil {
81
return nil, fmt.Errorf("error marshalling '%v' to YAML: %w", value, err)
0 commit comments