73
73
CreateDemoResources bool
74
74
Exclude string
75
75
Include string
76
+ IngressHost string
76
77
}
77
78
78
79
GitSourceDeleteOptions struct {
@@ -99,6 +100,7 @@ type (
99
100
runtimeName string
100
101
gsCloneOpts * git.CloneOptions
101
102
gsFs fs.FS
103
+ ingressHost string
102
104
}
103
105
)
104
106
@@ -249,6 +251,7 @@ func createDemoResources(ctx context.Context, opts *GitSourceCreateOptions, gsRe
249
251
runtimeName : opts .RuntimeName ,
250
252
gsCloneOpts : opts .GsCloneOpts ,
251
253
gsFs : gsFs ,
254
+ ingressHost : opts .IngressHost ,
252
255
})
253
256
if err != nil {
254
257
return fmt .Errorf ("failed to create github example pipeline. Error: %w" , err )
@@ -668,7 +671,7 @@ func createGithubExamplePipeline(opts *gitSourceGithubExampleOptions) error {
668
671
669
672
// Create a github eventsource that will listen to push events in the git source repo
670
673
gsRepoURL := opts .gsCloneOpts .URL ()
671
- eventSource := createGithubExampleEventSource (gsRepoURL )
674
+ eventSource := createGithubExampleEventSource (gsRepoURL , opts . ingressHost )
672
675
eventSourceFilePath := opts .gsFs .Join (opts .gsCloneOpts .Path (), store .Get ().GithubExampleEventSourceFileName )
673
676
err = opts .gsCloneOpts .FS .WriteYamls (eventSourceFilePath , eventSource )
674
677
if err != nil {
@@ -688,16 +691,15 @@ func createGithubExamplePipeline(opts *gitSourceGithubExampleOptions) error {
688
691
689
692
func createGithubExampleIngress () * netv1.Ingress {
690
693
return ingressutil .CreateIngress (& ingressutil.CreateIngressOptions {
691
- Name : store .Get ().GithubExampleIngressObjectName ,
694
+ Name : store .Get ().CodefreshDeliveryPipelines ,
692
695
Paths : []ingressutil.IngressPath {
693
696
{
694
697
Path : store .Get ().GithubExampleEventSourceEndpointPath ,
695
698
PathType : netv1 .PathTypeImplementationSpecific ,
696
699
ServiceName : store .Get ().GithubExampleEventSourceObjectName + "-eventsource-svc" ,
697
700
ServicePort : store .Get ().GithubExampleEventSourceServicePort ,
698
701
},
699
- },
700
- })
702
+ }, })
701
703
}
702
704
703
705
func getRepoOwnerAndNameFromRepoURL (repoURL string ) (owner string , name string ) {
@@ -708,7 +710,7 @@ func getRepoOwnerAndNameFromRepoURL(repoURL string) (owner string, name string)
708
710
return owner , name
709
711
}
710
712
711
- func createGithubExampleEventSource (repoURL string ) * eventsourcev1alpha1.EventSource {
713
+ func createGithubExampleEventSource (repoURL string , ingressHost string ) * eventsourcev1alpha1.EventSource {
712
714
repoOwner , repoName := getRepoOwnerAndNameFromRepoURL (repoURL )
713
715
714
716
return & eventsourcev1alpha1.EventSource {
@@ -733,7 +735,7 @@ func createGithubExampleEventSource(repoURL string) *eventsourcev1alpha1.EventSo
733
735
store .Get ().GithubExampleEventName : {
734
736
Webhook : & eventsourcev1alpha1.WebhookContext {
735
737
Endpoint : store .Get ().GithubExampleEventSourceEndpointPath ,
736
- URL : "http://replace-with-real-public-url" ,
738
+ URL : strings . Trim ( ingressHost , "/" ) ,
737
739
Port : store .Get ().GithubExampleEventSourceTargetPort ,
738
740
Method : "POST" ,
739
741
},
0 commit comments