mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 00:52:55 +00:00
More control over bytereadwriter options
- Override wrapping - Override function config
This commit is contained in:
@@ -43,6 +43,7 @@ type ByteReadWriter struct {
|
||||
|
||||
Results *yaml.RNode
|
||||
|
||||
NoWrap bool
|
||||
WrappingAPIVersion string
|
||||
WrappingKind string
|
||||
}
|
||||
@@ -53,10 +54,15 @@ func (rw *ByteReadWriter) Read() ([]*yaml.RNode, error) {
|
||||
OmitReaderAnnotations: rw.OmitReaderAnnotations,
|
||||
}
|
||||
val, err := b.Read()
|
||||
rw.FunctionConfig = b.FunctionConfig
|
||||
if rw.FunctionConfig == nil {
|
||||
rw.FunctionConfig = b.FunctionConfig
|
||||
}
|
||||
rw.Results = b.Results
|
||||
rw.WrappingAPIVersion = b.WrappingAPIVersion
|
||||
rw.WrappingKind = b.WrappingKind
|
||||
|
||||
if !rw.NoWrap {
|
||||
rw.WrappingAPIVersion = b.WrappingAPIVersion
|
||||
rw.WrappingKind = b.WrappingKind
|
||||
}
|
||||
return val, errors.Wrap(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user