File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ type templateData struct {
2727}
2828
2929var templateFuncs = map [string ]interface {}{
30- "indent" : indent ,
31- "fmtSampleConfig " : fmtSampleConfig ,
30+ "indent" : indent ,
31+ "rawfmt " : rawfmt ,
3232}
3333
3434var recipeVersions = [1 ]string {"v1beta1" }
@@ -94,7 +94,7 @@ func indent(spaces int, v string) string {
9494 return pad + strings .Replace (v , "\n " , "\n " + pad , - 1 )
9595}
9696
97- func fmtSampleConfig (s string ) string {
97+ func rawfmt (s string ) string {
9898 if ! strings .HasPrefix (s , "\n " ) {
9999 s = "\n " + s
100100 }
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ source:
44{{- with .Source }}
55 name : {{.Name}}
66 scope : {{.Scope}}
7- config : {{.SampleConfig | fmtSampleConfig | indent 4}}
7+ config : {{.SampleConfig | rawfmt | indent 4}}
88{{- end }}
99{{- if ne (len .Sinks) 0 }}
1010sinks :
1111{{- range $key, $value := .Sinks }}
1212 - name : {{$key}}
1313 {{- if $value}}
14- config : {{$value | fmtSampleConfig | indent 6}}
14+ config : {{$value | rawfmt | indent 6}}
1515 {{- end }}
1616{{- end }}
1717{{- end }}
@@ -20,7 +20,7 @@ processors:
2020{{- range $key, $value := .Processors }}
2121 - name : {{$key}}
2222 {{- if $value}}
23- config : {{$value | fmtSampleConfig | indent 6}}
23+ config : {{$value | rawfmt | indent 6}}
2424 {{- end }}
2525{{- end }}
2626{{- end }}
You can’t perform that action at this time.
0 commit comments