@@ -25,7 +25,7 @@ var renderCmd = &cobra.Command{
2525 Use : "render" ,
2626 Run : func (cmd * cobra.Command , args []string ) {
2727 templateReaders := make (map [string ]io.Reader )
28- valueReaders := make (map [string ]io.Reader )
28+ valueReaders := make (map [string ][] io.Reader )
2929 log := logger .New (nil )
3030 if len (renderCmdOptions .templates ) == 0 {
3131 dieOnError (fmt .Errorf ("No tempalte given" ), log )
@@ -51,7 +51,11 @@ var renderCmd = &cobra.Command{
5151 } else {
5252 valueReader = file
5353 }
54- valueReaders [renderCmdOptions .rootContext ] = valueReader
54+ if _ , ok := valueReaders [renderCmdOptions .rootContext ]; ! ok {
55+ valueReaders [renderCmdOptions .rootContext ] = []io.Reader {valueReader }
56+ } else {
57+ valueReaders [renderCmdOptions .rootContext ] = append (valueReaders [renderCmdOptions .rootContext ], valueReader )
58+ }
5559 } else {
5660 file , err = os .Open (values [1 ])
5761 dieOnError (err , log )
@@ -61,7 +65,11 @@ var renderCmd = &cobra.Command{
6165 } else {
6266 valueReader = file
6367 }
64- valueReaders [values [0 ]] = valueReader
68+ if _ , ok := valueReaders [values [0 ]]; ! ok {
69+ valueReaders [values [0 ]] = []io.Reader {valueReader }
70+ } else {
71+ valueReaders [values [0 ]] = append (valueReaders [values [0 ]], valueReader )
72+ }
6573 }
6674 defer file .Close ()
6775 }
@@ -84,6 +92,6 @@ func init() {
8492 renderCmd .Flags ().StringArrayVar (& renderCmdOptions .templates , "template" , []string {}, "Path to template file" )
8593 renderCmd .Flags ().StringArrayVar (& renderCmdOptions .values , "value" , []string {}, "Path to value file" )
8694 renderCmd .Flags ().StringVar (& renderCmdOptions .rootContext , "root-namespace" , "Values" , "Name of the root namespace (default: Values)" )
87- renderCmd .Flags ().StringVar (& renderCmdOptions .leftDelim , "left-delim" , "<< " , "Left delimiter (default: <<)" )
88- renderCmd .Flags ().StringVar (& renderCmdOptions .rightDelim , "right-delim" , ">> " , "Right delimiter (default: >>)" )
95+ renderCmd .Flags ().StringVar (& renderCmdOptions .leftDelim , "left-delim" , "{{ " , "Left delimiter (default: <<)" )
96+ renderCmd .Flags ().StringVar (& renderCmdOptions .rightDelim , "right-delim" , "}} " , "Right delimiter (default: >>)" )
8997}
0 commit comments