@@ -48,11 +48,11 @@ import (
48
48
49
49
type (
50
50
GitSourceCreateOptions struct {
51
- InsCloneOpts * git.CloneOptions
52
- GsCloneOpts * git.CloneOptions
53
- GsName string
54
- RuntimeName string
55
- FullGsPath string
51
+ InsCloneOpts * git.CloneOptions
52
+ GsCloneOpts * git.CloneOptions
53
+ GsName string
54
+ RuntimeName string
55
+ FullGsPath string
56
56
}
57
57
58
58
GitSourceDeleteOptions struct {
70
70
}
71
71
72
72
gitSourceCronExampleOptions struct {
73
- runtimeName string
74
- gsCloneOpts * git.CloneOptions
75
- gsFs fs.FS
73
+ runtimeName string
74
+ gsCloneOpts * git.CloneOptions
75
+ gsFs fs.FS
76
76
}
77
77
)
78
78
@@ -176,9 +176,9 @@ func RunGitSourceCreate(ctx context.Context, opts *GitSourceCreateOptions) error
176
176
177
177
if len (fi ) == 0 {
178
178
err = createCronExamplePipeline (& gitSourceCronExampleOptions {
179
- runtimeName : opts .RuntimeName ,
180
- gsCloneOpts : opts .GsCloneOpts ,
181
- gsFs : gsFs ,
179
+ runtimeName : opts .RuntimeName ,
180
+ gsCloneOpts : opts .GsCloneOpts ,
181
+ gsFs : gsFs ,
182
182
})
183
183
if err != nil {
184
184
return fmt .Errorf ("failed to create cron example pipeline. Error: %w" , err )
@@ -197,6 +197,7 @@ func RunGitSourceCreate(ctx context.Context, opts *GitSourceCreateOptions) error
197
197
Type : application .AppTypeDirectory ,
198
198
URL : opts .GsCloneOpts .Repo ,
199
199
}
200
+
200
201
if err := appDef .CreateApp (ctx , nil , opts .InsCloneOpts , opts .RuntimeName , store .Get ().CFGitSourceType ); err != nil {
201
202
return fmt .Errorf ("failed to create git-source application. Err: %w" , err )
202
203
}
@@ -211,17 +212,16 @@ func createCronExamplePipeline(opts *gitSourceCronExampleOptions) error {
211
212
return fmt .Errorf ("failed to create demo workflowTemplate: %w" , err )
212
213
}
213
214
214
- eventSourceFilePath := opts .gsFs .Join ("resources" , store .Get ().CronExampleEventSourceFileName )
215
- sensorFilePath := opts .gsFs .Join ("resources" , store .Get ().CronExampleSensorFileName )
215
+ eventSourceFilePath := opts .gsFs .Join (opts . gsCloneOpts . Path () , store .Get ().CronExampleEventSourceFileName )
216
+ sensorFilePath := opts .gsFs .Join (opts . gsCloneOpts . Path (), store .Get ().CronExampleSensorFileName )
216
217
217
218
eventSource := & eventsourcev1alpha1.EventSource {
218
219
TypeMeta : metav1.TypeMeta {
219
220
Kind : eventsourcereg .Kind ,
220
221
APIVersion : eventsourcereg .Group + "/v1alpha1" ,
221
222
},
222
223
ObjectMeta : metav1.ObjectMeta {
223
- Name : store .Get ().CronExampleEventSourceName ,
224
- Namespace : opts .runtimeName ,
224
+ Name : store .Get ().CronExampleEventSourceName ,
225
225
},
226
226
Spec : eventsourcev1alpha1.EventSourceSpec {
227
227
EventBusName : store .Get ().EventBusName ,
@@ -272,8 +272,7 @@ func createCronExampleSensor(triggers []sensorsv1alpha1.Trigger, runtimeName str
272
272
APIVersion : sensorreg .Group + "/v1alpha1" ,
273
273
},
274
274
ObjectMeta : metav1.ObjectMeta {
275
- Name : "cron" ,
276
- Namespace : runtimeName ,
275
+ Name : "cron" ,
277
276
},
278
277
Spec : sensorsv1alpha1.SensorSpec {
279
278
EventBusName : "codefresh-eventbus" ,
0 commit comments