@@ -89,6 +89,12 @@ type (
89
89
ingressHost string
90
90
ingressClass string
91
91
}
92
+
93
+ dirConfig struct {
94
+ application.Config
95
+ Exclude string `json:"exclude"`
96
+ Include string `json:"include"`
97
+ }
92
98
)
93
99
94
100
func NewGitSourceCommand () * cobra.Command {
@@ -258,7 +264,7 @@ func createDemoResources(ctx context.Context, opts *GitSourceCreateOptions, gsRe
258
264
}
259
265
260
266
func createCronExamplePipeline (opts * gitSourceCronExampleOptions ) error {
261
- err := createDemoWorkflowTemplate (opts .gsFs , opts . runtimeName )
267
+ err := createDemoWorkflowTemplate (opts .gsFs )
262
268
if err != nil {
263
269
return fmt .Errorf ("failed to create demo workflowTemplate: %w" , err )
264
270
}
@@ -278,7 +284,7 @@ func createCronExamplePipeline(opts *gitSourceCronExampleOptions) error {
278
284
return fmt .Errorf ("failed to create cron example trigger. Error: %w" , err )
279
285
}
280
286
281
- sensor , err := createCronExampleSensor (triggers , opts . runtimeName )
287
+ sensor , err := createCronExampleSensor (triggers )
282
288
if err != nil {
283
289
return fmt .Errorf ("failed to create cron example sensor. Error: %w" , err )
284
290
}
@@ -311,7 +317,7 @@ func createCronExampleEventSource() *eventsourcev1alpha1.EventSource {
311
317
}
312
318
}
313
319
314
- func createCronExampleSensor (triggers []sensorsv1alpha1.Trigger , runtimeName string ) (* sensorsv1alpha1.Sensor , error ) {
320
+ func createCronExampleSensor (triggers []sensorsv1alpha1.Trigger ) (* sensorsv1alpha1.Sensor , error ) {
315
321
dependencies := []sensorsv1alpha1.EventDependency {
316
322
{
317
323
Name : store .Get ().CronExampleDependencyName ,
@@ -585,20 +591,20 @@ func RunGitSourceEdit(ctx context.Context, opts *GitSourceEditOptions) error {
585
591
if err != nil {
586
592
return fmt .Errorf ("failed to clone the installation repo, attemptint to edit git-source %s. Err: %w" , opts .GsName , err )
587
593
}
588
-
589
- c := & application. Config {}
590
- err = fs .ReadJson (fs . Join ( apstore . Default . AppsDir , opts . GsName , opts . RuntimeName , "config.json" ) , c )
594
+ c := & dirConfig {}
595
+ fileName := fs . Join ( apstore . Default . AppsDir , opts . GsName , opts . RuntimeName , "config_dir.json" )
596
+ err = fs .ReadJson (fileName , c )
591
597
if err != nil {
592
- return fmt .Errorf ("failed to read the config.json of git-source: %s. Err: %w" , opts .GsName , err )
598
+ return fmt .Errorf ("failed to read the %s of git-source: %s. Err: %w" , fileName , opts .GsName , err )
593
599
}
594
600
595
601
c .SrcPath = opts .GsCloneOpts .Path ()
596
602
c .SrcRepoURL = opts .GsCloneOpts .URL ()
597
603
c .SrcTargetRevision = opts .GsCloneOpts .Revision ()
598
604
599
- err = fs .WriteJson (fs . Join ( apstore . Default . AppsDir , opts . GsName , opts . RuntimeName , "config.json" ) , c )
605
+ err = fs .WriteJson (fileName , c )
600
606
if err != nil {
601
- return fmt .Errorf ("failed to write the updated config.json of git-source: %s. Err: %w" , opts .GsName , err )
607
+ return fmt .Errorf ("failed to write the updated %s of git-source: %s. Err: %w" , fileName , opts .GsName , err )
602
608
}
603
609
604
610
log .G (ctx ).Info ("Pushing updated GitSource to the installation repo" )
@@ -609,7 +615,7 @@ func RunGitSourceEdit(ctx context.Context, opts *GitSourceEditOptions) error {
609
615
return nil
610
616
}
611
617
612
- func createDemoWorkflowTemplate (gsFs fs.FS , runtimeName string ) error {
618
+ func createDemoWorkflowTemplate (gsFs fs.FS ) error {
613
619
wfTemplate := & wfv1alpha1.WorkflowTemplate {
614
620
TypeMeta : metav1.TypeMeta {
615
621
Kind : wf .WorkflowTemplateKind ,
0 commit comments