mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
change marshal indent to 2 (#4005)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package yaml
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
@@ -20,8 +21,14 @@ type Node = yaml.Node
|
||||
type Style = yaml.Style
|
||||
type TypeError = yaml.TypeError
|
||||
type Unmarshaler = yaml.Unmarshaler
|
||||
|
||||
var Marshal = yaml.Marshal
|
||||
var Marshal = func (in interface{}) ([]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
err := NewEncoder(&buf).Encode(in)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
var Unmarshal = yaml.Unmarshal
|
||||
var NewDecoder = yaml.NewDecoder
|
||||
var NewEncoder = func(w io.Writer) *yaml.Encoder {
|
||||
|
||||
@@ -1171,7 +1171,7 @@ const (
|
||||
`
|
||||
bigMapYaml = `Kind: Service
|
||||
complextree:
|
||||
- field1:
|
||||
- field1:
|
||||
- boolfield: true
|
||||
floatsubfield: 1.01
|
||||
intsubfield: 1010
|
||||
@@ -1189,7 +1189,7 @@ complextree:
|
||||
floatsubfield: 1.021
|
||||
intsubfield: 1021
|
||||
stringsubfield: idx1021
|
||||
- field1:
|
||||
- field1:
|
||||
- boolfield: true
|
||||
floatsubfield: 1.11
|
||||
intsubfield: 1110
|
||||
@@ -1215,24 +1215,24 @@ spec:
|
||||
ports:
|
||||
port: 80
|
||||
that:
|
||||
- idx0
|
||||
- idx1
|
||||
- idx2
|
||||
- idx3
|
||||
- idx0
|
||||
- idx1
|
||||
- idx2
|
||||
- idx3
|
||||
these:
|
||||
- field1:
|
||||
- field1:
|
||||
- idx010
|
||||
- idx011
|
||||
field2:
|
||||
- idx020
|
||||
- idx021
|
||||
- field1:
|
||||
- field1:
|
||||
- idx110
|
||||
- idx111
|
||||
field2:
|
||||
- idx120
|
||||
- idx121
|
||||
- field1:
|
||||
- field1:
|
||||
- idx210
|
||||
- idx211
|
||||
field2:
|
||||
@@ -1247,11 +1247,11 @@ this:
|
||||
anEmptyMap: {}
|
||||
anEmptySlice: []
|
||||
those:
|
||||
- field1: idx0foo
|
||||
- field1: idx0foo
|
||||
field2: idx0bar
|
||||
- field1: idx1foo
|
||||
- field1: idx1foo
|
||||
field2: idx1bar
|
||||
- field1: idx2foo
|
||||
- field1: idx2foo
|
||||
field2: idx2bar
|
||||
`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user