@@ -69,27 +69,27 @@ func (p *pipelineRaw) newPipelineFromTemplate(templateMap map[string]string, glo
6969 if err := mergo .Merge (& t .Options , p .Options , mergo .WithOverride ); err != nil {
7070 return nil , fmt .Errorf ("%s merge template options faield: %+v" , p .TemplateName , err )
7171 }
72- // set default options
73- if t .Options == nil {
74- t .Options = RawOptions {}
75- }
7672 return & t , nil
7773}
7874
7975func (t * pipelineTemplate ) generatePipelineTool (app * app ) (* Tool , error ) {
8076 const configLocationKey = "configLocation"
81- // 1. get configurator by template type
77+ // 1.set default options
78+ if t .Options == nil {
79+ t .Options = RawOptions {}
80+ }
81+ // 2. get configurator by template type
8282 pipelineConfigurator , exist := optionConfiguratorMap [t .Type ]
8383 if ! exist {
8484 return nil , fmt .Errorf ("pipeline type [%s] not supported for now" , t .Type )
8585 }
86- // 2 . set default configLocation
86+ // 3 . set default configLocation
8787 if _ , configLocationExist := t .Options [configLocationKey ]; ! configLocationExist {
8888 if pipelineConfigurator .hasDefaultConfig () {
8989 t .Options [configLocationKey ] = pipelineConfigurator .defaultConfigLocation
9090 }
9191 }
92- // 3 . generate tool options
92+ // 4 . generate tool options
9393 pipelineFinalOptions := pipelineConfigurator .optionGeneratorFunc (t .Options , app )
9494 return newTool (t .Type , app .Name , pipelineFinalOptions ), nil
9595}
0 commit comments