@@ -79,6 +79,10 @@ type templateBulkFileInstance struct {
7979 Parameters []string `json:"parameters" yaml:"parameters"`
8080}
8181
82+ func templateInstanceKey (w sdk.WorkflowTemplateInstance ) string {
83+ return fmt .Sprintf ("%s/%s" , w .Project .Key , w .Request .WorkflowName )
84+ }
85+
8286func templateExtractAndValidateInstances (instanceKeys []string ) (map [string ]templateBulkInstancePath , error ) {
8387 minstances := make (map [string ]templateBulkInstancePath )
8488 for i := range instanceKeys {
@@ -269,7 +273,7 @@ func templateAskForInstances(wt *sdk.WorkflowTemplate, mwtis map[string]sdk.Work
269273 info = cli .Green ("up to date" )
270274 }
271275
272- _ , instanceGivenAsParam := moperations [instance . Key ( )]
276+ _ , instanceGivenAsParam := moperations [templateInstanceKey ( instance )]
273277 // selected by default if given as param or if no instances given as param an not up to date
274278 defaultSelected := instanceGivenAsParam || (instance .Workflow != nil && notUpToDate && len (moperations ) == 0 )
275279
@@ -360,7 +364,7 @@ func templateBulkRun(v cli.Values) error {
360364
361365 mwtis := make (map [string ]sdk.WorkflowTemplateInstance , len (wtis ))
362366 for _ , i := range wtis {
363- mwtis [i . Key ( )] = i
367+ mwtis [templateInstanceKey ( i )] = i
364368 }
365369
366370 moperations := templateInitOperationFromParams (mwtis , fileOperations , minstances , params )
@@ -377,7 +381,7 @@ func templateBulkRun(v cli.Values) error {
377381
378382 // ask interactively for params if prompt not disabled
379383 if ! v .GetBool ("no-interactive" ) {
380- sort .Slice (wtis , func (i , j int ) bool { return wtis [i ]. Key ( ) < wtis [j ]. Key ( ) })
384+ sort .Slice (wtis , func (i , j int ) bool { return templateInstanceKey ( wtis [i ]) < templateInstanceKey ( wtis [j ]) })
381385 if err := templateAskForInstances (wt , mwtis , minstances , moperations ); err != nil {
382386 return err
383387 }
@@ -505,7 +509,7 @@ func templateBulkRun(v cli.Values) error {
505509 }
506510
507511 if len (moperations ) == 0 {
508- fmt .Printf ("Nothing to do" )
512+ fmt .Println ("Nothing to do" )
509513 return nil
510514 }
511515
0 commit comments